1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2  *
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/. */
6 
7 #ifndef nsContentTreeOwner_h__
8 #define nsContentTreeOwner_h__
9 
10 // Helper Classes
11 #include "nsCOMPtr.h"
12 #include "nsString.h"
13 
14 // Interfaces Needed
15 #include "nsIBaseWindow.h"
16 #include "nsIDocShellTreeOwner.h"
17 #include "nsIInterfaceRequestor.h"
18 #include "nsIInterfaceRequestorUtils.h"
19 #include "nsIWebBrowserChrome3.h"
20 #include "nsIWindowProvider.h"
21 
22 namespace mozilla {
23 class AppWindow;
24 }
25 class nsSiteWindow;
26 
27 class nsContentTreeOwner final : public nsIDocShellTreeOwner,
28                                  public nsIBaseWindow,
29                                  public nsIInterfaceRequestor,
30                                  public nsIWebBrowserChrome3,
31                                  public nsIWindowProvider {
32   friend class mozilla::AppWindow;
33   friend class nsSiteWindow;
34 
35  public:
36   NS_DECL_ISUPPORTS
37 
38   NS_DECL_NSIBASEWINDOW
39   NS_DECL_NSIDOCSHELLTREEOWNER
40   NS_DECL_NSIINTERFACEREQUESTOR
41   NS_DECL_NSIWEBBROWSERCHROME
42   NS_DECL_NSIWEBBROWSERCHROME3
43   NS_DECL_NSIWINDOWPROVIDER
44 
45  protected:
46   explicit nsContentTreeOwner(bool fPrimary);
47   virtual ~nsContentTreeOwner();
48 
49   void AppWindow(mozilla::AppWindow* aAppWindow);
50   mozilla::AppWindow* AppWindow();
51 
52  private:
53   already_AddRefed<nsIWebBrowserChrome3> GetWebBrowserChrome();
54 
55  protected:
56   mozilla::AppWindow* mAppWindow;
57   nsSiteWindow* mSiteWindow;
58   bool mPrimary;
59 };
60 
61 #endif /* nsContentTreeOwner_h__ */
62