OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
(...skipping 10 matching lines...) Expand all Loading... |
21 class ExtensionView : public views::NativeViewHost { | 21 class ExtensionView : public views::NativeViewHost { |
22 public: | 22 public: |
23 ExtensionView(ExtensionHost* host, Browser* browser); | 23 ExtensionView(ExtensionHost* host, Browser* browser); |
24 virtual ~ExtensionView(); | 24 virtual ~ExtensionView(); |
25 | 25 |
26 // A class that represents the container that this view is in. | 26 // A class that represents the container that this view is in. |
27 // (bottom shelf, side bar, etc.) | 27 // (bottom shelf, side bar, etc.) |
28 class Container { | 28 class Container { |
29 public: | 29 public: |
30 virtual ~Container() {} | 30 virtual ~Container() {} |
31 // Mouse event notifications from the view. (useful for hover UI). | |
32 virtual void OnExtensionMouseMove(ExtensionView* view) = 0; | |
33 virtual void OnExtensionMouseLeave(ExtensionView* view) = 0; | |
34 virtual void OnExtensionPreferredSizeChanged(ExtensionView* view) {} | 31 virtual void OnExtensionPreferredSizeChanged(ExtensionView* view) {} |
35 }; | 32 }; |
36 | 33 |
37 ExtensionHost* host() const { return host_; } | 34 ExtensionHost* host() const { return host_; } |
38 Browser* browser() const { return browser_; } | 35 Browser* browser() const { return browser_; } |
39 const Extension* extension() const; | 36 const Extension* extension() const; |
40 RenderViewHost* render_view_host() const; | 37 RenderViewHost* render_view_host() const; |
41 void DidStopLoading(); | 38 void DidStopLoading(); |
42 void SetIsClipped(bool is_clipped); | 39 void SetIsClipped(bool is_clipped); |
43 | 40 |
44 // Notification from ExtensionHost. | 41 // Notification from ExtensionHost. |
45 void UpdatePreferredSize(const gfx::Size& new_size); | 42 void UpdatePreferredSize(const gfx::Size& new_size); |
46 void HandleMouseMove(); | |
47 void HandleMouseLeave(); | |
48 | 43 |
49 // Method for the ExtensionHost to notify us when the RenderViewHost has a | 44 // Method for the ExtensionHost to notify us when the RenderViewHost has a |
50 // connection. | 45 // connection. |
51 void RenderViewCreated(); | 46 void RenderViewCreated(); |
52 | 47 |
53 // Set a custom background for the view. The background will be tiled. | 48 // Set a custom background for the view. The background will be tiled. |
54 void SetBackground(const SkBitmap& background); | 49 void SetBackground(const SkBitmap& background); |
55 | 50 |
56 // Sets the container for this view. | 51 // Sets the container for this view. |
57 void SetContainer(Container* container) { container_ = container; } | 52 void SetContainer(Container* container) { container_ = container; } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // Note: the view does not own its container. | 98 // Note: the view does not own its container. |
104 Container* container_; | 99 Container* container_; |
105 | 100 |
106 // Whether this extension view is clipped. | 101 // Whether this extension view is clipped. |
107 bool is_clipped_; | 102 bool is_clipped_; |
108 | 103 |
109 DISALLOW_COPY_AND_ASSIGN(ExtensionView); | 104 DISALLOW_COPY_AND_ASSIGN(ExtensionView); |
110 }; | 105 }; |
111 | 106 |
112 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_VIEW_H_ | 107 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_VIEW_H_ |
OLD | NEW |