| 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" | |
| 10 #include "components/web_modal/web_contents_modal_dialog_host.h" | 9 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 11 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" | 10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" |
| 12 #include "extensions/browser/extension_host.h" | 11 #include "extensions/browser/extension_host.h" |
| 13 | 12 |
| 14 class Browser; | 13 class Browser; |
| 15 | 14 |
| 16 namespace content { | 15 namespace content { |
| 17 class SiteInstance; | 16 class SiteInstance; |
| 18 class WebContents; | 17 class WebContents; |
| 19 } | 18 } |
| 20 | 19 |
| 21 namespace extensions { | 20 namespace extensions { |
| 22 | 21 |
| 23 class ExtensionView; | 22 class ExtensionView; |
| 24 | 23 |
| 25 // The ExtensionHost for an extension that backs a view in the browser UI. For | 24 // The ExtensionHost for an extension that backs a view in the browser UI. For |
| 26 // example, this could be an extension popup, infobar or dialog, but not a | 25 // example, this could be an extension popup, infobar or dialog, but not a |
| 27 // background page. | 26 // background page. |
| 28 // TODO(gbillock): See if we can remove WebContentsModalDialogManager here. | |
| 29 class ExtensionViewHost | 27 class ExtensionViewHost |
| 30 : public ExtensionHost, | 28 : public ExtensionHost, |
| 31 public web_modal::WebContentsModalDialogManagerDelegate, | 29 public web_modal::WebContentsModalDialogManagerDelegate, |
| 32 public web_modal::WebContentsModalDialogHost { | 30 public web_modal::WebContentsModalDialogHost { |
| 33 public: | 31 public: |
| 34 ExtensionViewHost(const Extension* extension, | 32 ExtensionViewHost(const Extension* extension, |
| 35 content::SiteInstance* site_instance, | 33 content::SiteInstance* site_instance, |
| 36 const GURL& url, | 34 const GURL& url, |
| 37 ViewType host_type); | 35 ViewType host_type); |
| 38 virtual ~ExtensionViewHost(); | 36 virtual ~ExtensionViewHost(); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // Optional view that shows the rendered content in the UI. | 123 // Optional view that shows the rendered content in the UI. |
| 126 scoped_ptr<ExtensionView> view_; | 124 scoped_ptr<ExtensionView> view_; |
| 127 | 125 |
| 128 // The relevant WebContents associated with this ExtensionViewHost, if any. | 126 // The relevant WebContents associated with this ExtensionViewHost, if any. |
| 129 content::WebContents* associated_web_contents_; | 127 content::WebContents* associated_web_contents_; |
| 130 | 128 |
| 131 // Observer to detect when the associated web contents is destroyed. | 129 // Observer to detect when the associated web contents is destroyed. |
| 132 class AssociatedWebContentsObserver; | 130 class AssociatedWebContentsObserver; |
| 133 scoped_ptr<AssociatedWebContentsObserver> associated_web_contents_observer_; | 131 scoped_ptr<AssociatedWebContentsObserver> associated_web_contents_observer_; |
| 134 | 132 |
| 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 | |
| 141 DISALLOW_COPY_AND_ASSIGN(ExtensionViewHost); | 133 DISALLOW_COPY_AND_ASSIGN(ExtensionViewHost); |
| 142 }; | 134 }; |
| 143 | 135 |
| 144 } // namespace extensions | 136 } // namespace extensions |
| 145 | 137 |
| 146 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_HOST_H_ | 138 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_VIEW_HOST_H_ |
| OLD | NEW |