| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_GTK_EXTENSION_VIEW_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_EXTENSION_VIEW_GTK_H_ |
| 6 #define CHROME_BROWSER_GTK_EXTENSION_VIEW_GTK_H_ | 6 #define CHROME_BROWSER_GTK_EXTENSION_VIEW_GTK_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/gfx/native_widget_types.h" | 9 #include "base/gfx/native_widget_types.h" |
| 10 | 10 |
| 11 class Browser; |
| 11 class ExtensionHost; | 12 class ExtensionHost; |
| 12 class RenderViewHost; | 13 class RenderViewHost; |
| 13 class RenderWidgetHostViewGtk; | 14 class RenderWidgetHostViewGtk; |
| 14 | 15 |
| 15 class ExtensionViewGtk { | 16 class ExtensionViewGtk { |
| 16 public: | 17 public: |
| 17 explicit ExtensionViewGtk(ExtensionHost* extension_host); | 18 ExtensionViewGtk(ExtensionHost* extension_host, Browser* browser); |
| 19 |
| 20 void Init(); |
| 18 | 21 |
| 19 gfx::NativeView native_view(); | 22 gfx::NativeView native_view(); |
| 23 Browser* browser() const { return browser_; } |
| 20 | 24 |
| 21 bool is_toolstrip() const { return is_toolstrip_; } | 25 bool is_toolstrip() const { return is_toolstrip_; } |
| 22 void set_is_toolstrip(bool is_toolstrip) { is_toolstrip_ = is_toolstrip; } | 26 void set_is_toolstrip(bool is_toolstrip) { is_toolstrip_ = is_toolstrip; } |
| 23 | 27 |
| 24 // Method for the ExtensionHost to notify us about the correct width for | 28 // Method for the ExtensionHost to notify us about the correct width for |
| 25 // extension contents. | 29 // extension contents. |
| 26 void UpdatePreferredWidth(int pref_width); | 30 void UpdatePreferredWidth(int pref_width); |
| 27 | 31 |
| 28 private: | 32 private: |
| 29 RenderViewHost* render_view_host() const; | 33 RenderViewHost* render_view_host() const; |
| 30 | 34 |
| 31 void CreateWidgetHostView(); | 35 void CreateWidgetHostView(); |
| 32 | 36 |
| 33 // True if the contents are being displayed inside the extension shelf. | 37 // True if the contents are being displayed inside the extension shelf. |
| 34 bool is_toolstrip_; | 38 bool is_toolstrip_; |
| 35 | 39 |
| 40 Browser* browser_; |
| 41 |
| 36 ExtensionHost* extension_host_; | 42 ExtensionHost* extension_host_; |
| 37 | 43 |
| 38 RenderWidgetHostViewGtk* render_widget_host_view_; | 44 RenderWidgetHostViewGtk* render_widget_host_view_; |
| 39 | 45 |
| 40 DISALLOW_COPY_AND_ASSIGN(ExtensionViewGtk); | 46 DISALLOW_COPY_AND_ASSIGN(ExtensionViewGtk); |
| 41 }; | 47 }; |
| 42 | 48 |
| 43 #endif // CHROME_BROWSER_GTK_EXTENSION_VIEW_GTK_H_ | 49 #endif // CHROME_BROWSER_GTK_EXTENSION_VIEW_GTK_H_ |
| OLD | NEW |