Chromium Code Reviews| Index: chrome/browser/ui/views/extensions/extension_view_views.h |
| diff --git a/chrome/browser/ui/views/extensions/extension_view_views.h b/chrome/browser/ui/views/extensions/extension_view_views.h |
| index bb490f6400d2042cafe23b16b9f066214fb5b90f..fcc28aa03c1d9dc19098c2339fb399d7b1bb5ab9 100644 |
| --- a/chrome/browser/ui/views/extensions/extension_view_views.h |
| +++ b/chrome/browser/ui/views/extensions/extension_view_views.h |
| @@ -7,11 +7,10 @@ |
| #include "base/basictypes.h" |
| #include "base/compiler_specific.h" |
| +#include "chrome/browser/extensions/extension_view.h" |
| #include "third_party/skia/include/core/SkBitmap.h" |
| #include "ui/views/controls/native/native_view_host.h" |
| -class Browser; |
| - |
| namespace content { |
| class RenderViewHost; |
| } |
| @@ -22,48 +21,25 @@ class ExtensionHost; |
| } |
| // This handles the display portion of an ExtensionHost. |
| -class ExtensionViewViews : public views::NativeViewHost { |
| +class ExtensionViewViews : public ExtensionView, |
|
Ben Goodger (Google)
2012/09/17 16:07:17
Because ExtensionViews are owned by the ExtensionH
tfarina
2012/09/19 01:21:39
Done.
|
| + public views::NativeViewHost { |
| public: |
| ExtensionViewViews(extensions::ExtensionHost* host, Browser* browser); |
| virtual ~ExtensionViewViews(); |
| - // A class that represents the container that this view is in. |
| - // (bottom shelf, side bar, etc.) |
| - class Container { |
| - public: |
| - virtual ~Container() {} |
| - virtual void OnExtensionSizeChanged(ExtensionViewViews* view) {} |
| - virtual void OnViewWasResized() {} |
| - }; |
| - |
| - extensions::ExtensionHost* host() const { return host_; } |
| - Browser* browser() const { return browser_; } |
| - const extensions::Extension* extension() const; |
| - content::RenderViewHost* render_view_host() const; |
| - void DidStopLoading(); |
| - void SetIsClipped(bool is_clipped); |
| - |
| - // Notification from ExtensionHost. |
| - void ResizeDueToAutoResize(const gfx::Size& new_size); |
| - |
| - // Method for the ExtensionHost to notify us when the RenderViewHost has a |
| - // connection. |
| - void RenderViewCreated(); |
| - |
| // Set a custom background for the view. The background will be tiled. |
| void SetBackground(const SkBitmap& background); |
| - // Sets the container for this view. |
| - void SetContainer(Container* container) { container_ = container; } |
| + // Overridden from views::View: |
| + virtual void SetVisible(bool is_visible) OVERRIDE; |
| + protected: |
| // Overridden from views::NativeViewHost: |
| virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; |
| - virtual void SetVisible(bool is_visible) OVERRIDE; |
| virtual void ViewHierarchyChanged(bool is_add, |
| views::View* parent, |
| views::View* child) OVERRIDE; |
| - protected: |
| // Overridden from views::View. |
| virtual void PreferredSizeChanged() OVERRIDE; |
| virtual bool SkipDefaultKeyEventProcessing(const ui::KeyEvent& e) OVERRIDE; |
| @@ -72,6 +48,17 @@ class ExtensionViewViews : public views::NativeViewHost { |
| private: |
| friend class extensions::ExtensionHost; |
| + // Overridden from ExtensionView: |
| + virtual Browser* GetBrowser() OVERRIDE; |
| + virtual const Browser* GetBrowser() const OVERRIDE; |
| + virtual gfx::NativeView GetNativeView() OVERRIDE; |
| + virtual content::RenderViewHost* GetRenderViewHost() const OVERRIDE; |
| + virtual void SetContainer(ExtensionViewContainer* container) OVERRIDE; |
| + virtual void ResizeDueToAutoResize(const gfx::Size& new_size) OVERRIDE; |
| + virtual void RenderViewCreated() OVERRIDE; |
| + virtual void DidStopLoading() OVERRIDE; |
| + virtual void WindowFrameChanged() OVERRIDE; |
| + |
| // Initializes the RenderWidgetHostView for this object. |
| void CreateWidgetHostView(); |
| @@ -102,10 +89,7 @@ class ExtensionViewViews : public views::NativeViewHost { |
| // The container this view is in (not necessarily its direct superview). |
| // Note: the view does not own its container. |
| - Container* container_; |
| - |
| - // Whether this extension view is clipped. |
| - bool is_clipped_; |
| + ExtensionViewContainer* container_; |
| DISALLOW_COPY_AND_ASSIGN(ExtensionViewViews); |
| }; |