diff options
author | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-03 00:37:31 +0000 |
---|---|---|
committer | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-03 00:37:31 +0000 |
commit | 1c1c77a5021be0b902240a4f78009a8d8f71d1ac (patch) | |
tree | c1afb46b67de923afaac68340ddb0113b7306193 /chrome/browser/extensions/extension_host.h | |
parent | 23b3f6c67270a6aff5020c9a7279f4ed84192a02 (diff) | |
download | chromium_src-1c1c77a5021be0b902240a4f78009a8d8f71d1ac.zip chromium_src-1c1c77a5021be0b902240a4f78009a8d8f71d1ac.tar.gz chromium_src-1c1c77a5021be0b902240a4f78009a8d8f71d1ac.tar.bz2 |
Submitting change from http://codereview.chromium.org/276029/show
BUG=none
TEST=none
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30778 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_host.h')
-rw-r--r-- | chrome/browser/extensions/extension_host.h | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extension_host.h b/chrome/browser/extensions/extension_host.h index ea9660d..bf66579 100644 --- a/chrome/browser/extensions/extension_host.h +++ b/chrome/browser/extensions/extension_host.h @@ -12,6 +12,7 @@ #include "chrome/browser/renderer_host/render_view_host_delegate.h" #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" #if defined(TOOLKIT_VIEWS) +#include "chrome/browser/views/browser_bubble.h" #include "chrome/browser/views/extensions/extension_view.h" #elif defined(OS_LINUX) #include "chrome/browser/gtk/extension_view_gtk.h" @@ -20,8 +21,12 @@ #endif #include "chrome/common/notification_registrar.h" + class Browser; class Extension; +#if defined(TOOLKIT_VIEWS) +class ExtensionPopup; +#endif class ExtensionProcessManager; class RenderProcessHost; class RenderWidgetHost; @@ -33,7 +38,11 @@ struct WebPreferences; // It handles setting up the renderer process, if needed, with special // privileges available to extensions. It may have a view to be shown in the // in the browser UI, or it may be hidden. -class ExtensionHost : public RenderViewHostDelegate, +class ExtensionHost : // NOLINT +#if defined(TOOLKIT_VIEWS) + public BrowserBubble::Delegate, +#endif + public RenderViewHostDelegate, public RenderViewHostDelegate::View, public ExtensionFunctionDispatcher::Delegate, public NotificationObserver { @@ -72,6 +81,14 @@ class ExtensionHost : public RenderViewHostDelegate, } Profile* profile() const { return profile_; } +#if defined(TOOLKIT_VIEWS) + ExtensionPopup* child_popup() const { return child_popup_; } + void set_child_popup(ExtensionPopup* popup) { child_popup_ = popup; } +#endif + + // Dismiss the hosted pop-up, if one is present. + void DismissPopup(); + // Sets the the ViewType of this host (e.g. mole, toolstrip). void SetRenderViewType(ViewType::Type type); @@ -89,6 +106,22 @@ class ExtensionHost : public RenderViewHostDelegate, // Insert the theme CSS for a toolstrip/mole. void InsertThemeCSS(); +#if defined(TOOLKIT_VIEWS) + // BrowserBubble::Delegate implementation. + // Called when the Browser Window that this bubble is attached to moves. + virtual void BubbleBrowserWindowMoved(BrowserBubble* bubble); + + // Called with the Browser Window that this bubble is attached to is + // about to close. + virtual void BubbleBrowserWindowClosing(BrowserBubble* bubble); + + // Called when the bubble became active / got focus. + virtual void BubbleGotFocus(BrowserBubble* bubble); + + // Called when the bubble became inactive / lost focus. + virtual void BubbleLostFocus(BrowserBubble* bubble); +#endif // defined(TOOLKIT_VIEWS) + // RenderViewHostDelegate implementation. virtual RenderViewHostDelegate::View* GetViewDelegate(); virtual const GURL& GetURL() const { return url_; } @@ -192,12 +225,18 @@ class ExtensionHost : public RenderViewHostDelegate, // The URL being hosted. GURL url_; +#if defined(TOOLKIT_VIEWS) + // A popup view that is anchored to and owned by this ExtensionHost. However, + // the popup contains its own separate ExtensionHost + ExtensionPopup* child_popup_; +#endif + NotificationRegistrar registrar_; scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_; - // Only EXTENSION_TOOLSTRIP and EXTENSION_BACKGROUND_PAGE are used here, - // others are not hostd by ExtensionHost. + // Only EXTENSION_TOOLSTRIP, EXTENSION_POPUP, and EXTENSION_BACKGROUND_PAGE + // are used here, others are not hosted by ExtensionHost. ViewType::Type extension_host_type_; DISALLOW_COPY_AND_ASSIGN(ExtensionHost); |