| 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 Browser; |
| 12 class ExtensionHost; | 12 class ExtensionHost; |
| 13 class RenderViewHost; | 13 class RenderViewHost; |
| 14 class RenderWidgetHostViewGtk; | 14 class RenderWidgetHostViewGtk; |
| 15 class SkBitmap; |
| 15 | 16 |
| 16 class ExtensionViewGtk { | 17 class ExtensionViewGtk { |
| 17 public: | 18 public: |
| 18 ExtensionViewGtk(ExtensionHost* extension_host, Browser* browser); | 19 ExtensionViewGtk(ExtensionHost* extension_host, Browser* browser); |
| 19 | 20 |
| 20 void Init(); | 21 void Init(); |
| 21 | 22 |
| 22 gfx::NativeView native_view(); | 23 gfx::NativeView native_view(); |
| 23 Browser* browser() const { return browser_; } | 24 Browser* browser() const { return browser_; } |
| 24 | 25 |
| 25 bool is_toolstrip() const { return is_toolstrip_; } | 26 bool is_toolstrip() const { return is_toolstrip_; } |
| 26 void set_is_toolstrip(bool is_toolstrip) { is_toolstrip_ = is_toolstrip; } | 27 void set_is_toolstrip(bool is_toolstrip) { is_toolstrip_ = is_toolstrip; } |
| 27 | 28 |
| 29 void SetBackground(const SkBitmap& background); |
| 30 |
| 28 // Method for the ExtensionHost to notify us about the correct width for | 31 // Method for the ExtensionHost to notify us about the correct width for |
| 29 // extension contents. | 32 // extension contents. |
| 30 void UpdatePreferredWidth(int pref_width); | 33 void UpdatePreferredWidth(int pref_width); |
| 31 | 34 |
| 32 private: | 35 private: |
| 33 RenderViewHost* render_view_host() const; | 36 RenderViewHost* render_view_host() const; |
| 34 | 37 |
| 35 void CreateWidgetHostView(); | 38 void CreateWidgetHostView(); |
| 36 | 39 |
| 37 // True if the contents are being displayed inside the extension shelf. | 40 // True if the contents are being displayed inside the extension shelf. |
| 38 bool is_toolstrip_; | 41 bool is_toolstrip_; |
| 39 | 42 |
| 40 Browser* browser_; | 43 Browser* browser_; |
| 41 | 44 |
| 42 ExtensionHost* extension_host_; | 45 ExtensionHost* extension_host_; |
| 43 | 46 |
| 44 RenderWidgetHostViewGtk* render_widget_host_view_; | 47 RenderWidgetHostViewGtk* render_widget_host_view_; |
| 45 | 48 |
| 46 DISALLOW_COPY_AND_ASSIGN(ExtensionViewGtk); | 49 DISALLOW_COPY_AND_ASSIGN(ExtensionViewGtk); |
| 47 }; | 50 }; |
| 48 | 51 |
| 49 #endif // CHROME_BROWSER_GTK_EXTENSION_VIEW_GTK_H_ | 52 #endif // CHROME_BROWSER_GTK_EXTENSION_VIEW_GTK_H_ |
| OLD | NEW |