Bug 1728955: part 3) Add logging to `nsBaseClipboard`. r=masayuki
[gecko.git] / dom / base / nsPIDOMWindowInlines.h
blob028762abf7ccb29562e813d5447246c03ae1fe05
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef dom_base_nsPIDOMWindowInlines_h___
8 #define dom_base_nsPIDOMWindowInlines_h___
10 inline bool nsPIDOMWindowOuter::IsLoading() const {
11 auto* win = GetCurrentInnerWindow();
13 if (!win) {
14 NS_ERROR("No current inner window available!");
16 return false;
19 return win->IsLoading();
22 inline bool nsPIDOMWindowInner::IsLoading() const {
23 if (!mOuterWindow) {
24 NS_ERROR("IsLoading() called on orphan inner window!");
26 return false;
29 return !mIsDocumentLoaded;
32 inline bool nsPIDOMWindowOuter::IsHandlingResizeEvent() const {
33 auto* win = GetCurrentInnerWindow();
35 if (!win) {
36 NS_ERROR("No current inner window available!");
38 return false;
41 return win->IsHandlingResizeEvent();
44 inline bool nsPIDOMWindowInner::IsHandlingResizeEvent() const {
45 if (!mOuterWindow) {
46 NS_ERROR("IsHandlingResizeEvent() called on orphan inner window!");
48 return false;
51 return mIsHandlingResizeEvent;
54 inline bool nsPIDOMWindowInner::HasActiveDocument() {
55 return IsCurrentInnerWindow();
58 inline bool nsPIDOMWindowInner::IsTopInnerWindow() const {
59 return mTopInnerWindow == this;
62 inline nsIDocShell* nsPIDOMWindowOuter::GetDocShell() const {
63 return mDocShell;
66 inline nsIDocShell* nsPIDOMWindowInner::GetDocShell() const {
67 return mOuterWindow ? mOuterWindow->GetDocShell() : nullptr;
70 inline mozilla::dom::BrowsingContext* nsPIDOMWindowOuter::GetBrowsingContext()
71 const {
72 return mBrowsingContext;
75 inline mozilla::dom::BrowsingContext* nsPIDOMWindowInner::GetBrowsingContext()
76 const {
77 return mBrowsingContext;
80 inline mozilla::dom::Element* nsPIDOMWindowOuter::GetFocusedElement() const {
81 return mInnerWindow ? mInnerWindow->GetFocusedElement() : nullptr;
84 inline bool nsPIDOMWindowOuter::UnknownFocusMethodShouldShowOutline() const {
85 return mInnerWindow && mInnerWindow->UnknownFocusMethodShouldShowOutline();
88 #endif