OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_HOST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_HOST_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_HOST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_HOST_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "components/web_modal/popup_manager.h" |
9 #include "components/web_modal/web_contents_modal_dialog_host.h" | 10 #include "components/web_modal/web_contents_modal_dialog_host.h" |
10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 11 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
11 #include "extensions/browser/extension_host.h" | 12 #include "extensions/browser/extension_host.h" |
12 | 13 |
13 class Browser; | 14 class Browser; |
14 | 15 |
15 namespace content { | 16 namespace content { |
16 class SiteInstance; | 17 class SiteInstance; |
17 class WebContents; | 18 class WebContents; |
18 } | 19 } |
19 | 20 |
20 namespace extensions { | 21 namespace extensions { |
21 | 22 |
22 class ExtensionView; | 23 class ExtensionView; |
23 | 24 |
24 // The ExtensionHost for an extension that backs a view in the browser UI. For | 25 // The ExtensionHost for an extension that backs a view in the browser UI. For |
25 // example, this could be an extension popup, infobar or dialog, but not a | 26 // example, this could be an extension popup, infobar or dialog, but not a |
26 // background page. | 27 // background page. |
| 28 // TODO(gbillock): See if we can remove WebContentsModalDialogManager here. |
27 class ExtensionViewHost | 29 class ExtensionViewHost |
28 : public ExtensionHost, | 30 : public ExtensionHost, |
29 public web_modal::WebContentsModalDialogManagerDelegate, | 31 public web_modal::WebContentsModalDialogManagerDelegate, |
30 public web_modal::WebContentsModalDialogHost { | 32 public web_modal::WebContentsModalDialogHost { |
31 public: | 33 public: |
32 ExtensionViewHost(const Extension* extension, | 34 ExtensionViewHost(const Extension* extension, |
33 content::SiteInstance* site_instance, | 35 content::SiteInstance* site_instance, |
34 const GURL& url, | 36 const GURL& url, |
35 ViewType host_type); | 37 ViewType host_type); |
36 virtual ~ExtensionViewHost(); | 38 virtual ~ExtensionViewHost(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // Optional view that shows the rendered content in the UI. | 125 // Optional view that shows the rendered content in the UI. |
124 scoped_ptr<ExtensionView> view_; | 126 scoped_ptr<ExtensionView> view_; |
125 | 127 |
126 // The relevant WebContents associated with this ExtensionViewHost, if any. | 128 // The relevant WebContents associated with this ExtensionViewHost, if any. |
127 content::WebContents* associated_web_contents_; | 129 content::WebContents* associated_web_contents_; |
128 | 130 |
129 // Observer to detect when the associated web contents is destroyed. | 131 // Observer to detect when the associated web contents is destroyed. |
130 class AssociatedWebContentsObserver; | 132 class AssociatedWebContentsObserver; |
131 scoped_ptr<AssociatedWebContentsObserver> associated_web_contents_observer_; | 133 scoped_ptr<AssociatedWebContentsObserver> associated_web_contents_observer_; |
132 | 134 |
| 135 // Manage popups overlaying the WebContents in this EVH. |
| 136 // TODO(gbillock): should usually not be used -- instead use the parent |
| 137 // window's popup manager. Should only be used when the EVH is created without |
| 138 // a parent window. |
| 139 scoped_ptr<web_modal::PopupManager> popup_manager_; |
| 140 |
133 DISALLOW_COPY_AND_ASSIGN(ExtensionViewHost); | 141 DISALLOW_COPY_AND_ASSIGN(ExtensionViewHost); |
134 }; | 142 }; |
135 | 143 |
136 } // namespace extensions | 144 } // namespace extensions |
137 | 145 |
138 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_HOST_H_ | 146 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_HOST_H_ |
OLD | NEW |