summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_host.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/extensions/extension_host.h')
-rw-r--r--chrome/browser/extensions/extension_host.h45
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);