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; | |
16 class ExtensionHost; | 15 class ExtensionHost; |
17 class ExtensionView; | 16 class ExtensionView; |
18 | 17 |
| 18 namespace extensions { |
| 19 class Extension; |
| 20 } |
| 21 |
19 namespace content { | 22 namespace content { |
20 class RenderViewHost; | 23 class RenderViewHost; |
21 } | 24 } |
22 | 25 |
23 // This handles the display portion of an ExtensionHost. | 26 // This handles the display portion of an ExtensionHost. |
24 class ExtensionView : public views::NativeViewHost { | 27 class ExtensionView : public views::NativeViewHost { |
25 public: | 28 public: |
26 ExtensionView(ExtensionHost* host, Browser* browser); | 29 ExtensionView(ExtensionHost* host, Browser* browser); |
27 virtual ~ExtensionView(); | 30 virtual ~ExtensionView(); |
28 | 31 |
29 // A class that represents the container that this view is in. | 32 // A class that represents the container that this view is in. |
30 // (bottom shelf, side bar, etc.) | 33 // (bottom shelf, side bar, etc.) |
31 class Container { | 34 class Container { |
32 public: | 35 public: |
33 virtual ~Container() {} | 36 virtual ~Container() {} |
34 virtual void OnExtensionSizeChanged(ExtensionView* view) {} | 37 virtual void OnExtensionSizeChanged(ExtensionView* view) {} |
35 virtual void OnViewWasResized() {} | 38 virtual void OnViewWasResized() {} |
36 }; | 39 }; |
37 | 40 |
38 ExtensionHost* host() const { return host_; } | 41 ExtensionHost* host() const { return host_; } |
39 Browser* browser() const { return browser_; } | 42 Browser* browser() const { return browser_; } |
40 const Extension* extension() const; | 43 const extensions::Extension* extension() const; |
41 content::RenderViewHost* render_view_host() const; | 44 content::RenderViewHost* render_view_host() const; |
42 void DidStopLoading(); | 45 void DidStopLoading(); |
43 void SetIsClipped(bool is_clipped); | 46 void SetIsClipped(bool is_clipped); |
44 | 47 |
45 // Notification from ExtensionHost. | 48 // Notification from ExtensionHost. |
46 void ResizeDueToAutoResize(const gfx::Size& new_size); | 49 void ResizeDueToAutoResize(const gfx::Size& new_size); |
47 | 50 |
48 // Method for the ExtensionHost to notify us when the RenderViewHost has a | 51 // Method for the ExtensionHost to notify us when the RenderViewHost has a |
49 // connection. | 52 // connection. |
50 void RenderViewCreated(); | 53 void RenderViewCreated(); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // Note: the view does not own its container. | 105 // Note: the view does not own its container. |
103 Container* container_; | 106 Container* container_; |
104 | 107 |
105 // Whether this extension view is clipped. | 108 // Whether this extension view is clipped. |
106 bool is_clipped_; | 109 bool is_clipped_; |
107 | 110 |
108 DISALLOW_COPY_AND_ASSIGN(ExtensionView); | 111 DISALLOW_COPY_AND_ASSIGN(ExtensionView); |
109 }; | 112 }; |
110 | 113 |
111 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_VIEW_H_ | 114 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_VIEW_H_ |
OLD | NEW |