| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_VIEWS_EXTENSIONS_EXTENSION_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| 11 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.h" |
| 12 #include "ui/views/controls/native/native_view_host.h" | 12 #include "ui/views/controls/native/native_view_host.h" |
| 13 | 13 |
| 14 class Browser; | 14 class Browser; |
| 15 class Extension; | 15 class Extension; |
| 16 class ExtensionHost; | 16 class ExtensionHost; |
| 17 class ExtensionView; | 17 class ExtensionView; |
| 18 |
| 19 namespace content { |
| 18 class RenderViewHost; | 20 class RenderViewHost; |
| 21 } |
| 19 | 22 |
| 20 // This handles the display portion of an ExtensionHost. | 23 // This handles the display portion of an ExtensionHost. |
| 21 class ExtensionView : public views::NativeViewHost { | 24 class ExtensionView : public views::NativeViewHost { |
| 22 public: | 25 public: |
| 23 ExtensionView(ExtensionHost* host, Browser* browser); | 26 ExtensionView(ExtensionHost* host, Browser* browser); |
| 24 virtual ~ExtensionView(); | 27 virtual ~ExtensionView(); |
| 25 | 28 |
| 26 // A class that represents the container that this view is in. | 29 // A class that represents the container that this view is in. |
| 27 // (bottom shelf, side bar, etc.) | 30 // (bottom shelf, side bar, etc.) |
| 28 class Container { | 31 class Container { |
| 29 public: | 32 public: |
| 30 virtual ~Container() {} | 33 virtual ~Container() {} |
| 31 virtual void OnExtensionPreferredSizeChanged(ExtensionView* view) {} | 34 virtual void OnExtensionPreferredSizeChanged(ExtensionView* view) {} |
| 32 virtual void OnViewWasResized() {} | 35 virtual void OnViewWasResized() {} |
| 33 }; | 36 }; |
| 34 | 37 |
| 35 ExtensionHost* host() const { return host_; } | 38 ExtensionHost* host() const { return host_; } |
| 36 Browser* browser() const { return browser_; } | 39 Browser* browser() const { return browser_; } |
| 37 const Extension* extension() const; | 40 const Extension* extension() const; |
| 38 RenderViewHost* render_view_host() const; | 41 content::RenderViewHost* render_view_host() const; |
| 39 void DidStopLoading(); | 42 void DidStopLoading(); |
| 40 void SetIsClipped(bool is_clipped); | 43 void SetIsClipped(bool is_clipped); |
| 41 | 44 |
| 42 // Notification from ExtensionHost. | 45 // Notification from ExtensionHost. |
| 43 void UpdatePreferredSize(const gfx::Size& new_size); | 46 void UpdatePreferredSize(const gfx::Size& new_size); |
| 44 | 47 |
| 45 // Method for the ExtensionHost to notify us when the RenderViewHost has a | 48 // Method for the ExtensionHost to notify us when the RenderViewHost has a |
| 46 // connection. | 49 // connection. |
| 47 void RenderViewCreated(); | 50 void RenderViewCreated(); |
| 48 | 51 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // Note: the view does not own its container. | 102 // Note: the view does not own its container. |
| 100 Container* container_; | 103 Container* container_; |
| 101 | 104 |
| 102 // Whether this extension view is clipped. | 105 // Whether this extension view is clipped. |
| 103 bool is_clipped_; | 106 bool is_clipped_; |
| 104 | 107 |
| 105 DISALLOW_COPY_AND_ASSIGN(ExtensionView); | 108 DISALLOW_COPY_AND_ASSIGN(ExtensionView); |
| 106 }; | 109 }; |
| 107 | 110 |
| 108 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_VIEW_H_ | 111 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_VIEW_H_ |
| OLD | NEW |