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; |
31 virtual void OnExtensionPreferredSizeChanged(ExtensionView* view) {} | 34 virtual void OnExtensionPreferredSizeChanged(ExtensionView* view) {} |
32 }; | 35 }; |
33 | 36 |
34 ExtensionHost* host() const { return host_; } | 37 ExtensionHost* host() const { return host_; } |
35 Browser* browser() const { return browser_; } | 38 Browser* browser() const { return browser_; } |
36 const Extension* extension() const; | 39 const Extension* extension() const; |
37 RenderViewHost* render_view_host() const; | 40 RenderViewHost* render_view_host() const; |
38 void DidStopLoading(); | 41 void DidStopLoading(); |
39 void SetIsClipped(bool is_clipped); | 42 void SetIsClipped(bool is_clipped); |
40 | 43 |
41 // Notification from ExtensionHost. | 44 // Notification from ExtensionHost. |
42 void UpdatePreferredSize(const gfx::Size& new_size); | 45 void UpdatePreferredSize(const gfx::Size& new_size); |
| 46 void HandleMouseMove(); |
| 47 void HandleMouseLeave(); |
43 | 48 |
44 // Method for the ExtensionHost to notify us when the RenderViewHost has a | 49 // Method for the ExtensionHost to notify us when the RenderViewHost has a |
45 // connection. | 50 // connection. |
46 void RenderViewCreated(); | 51 void RenderViewCreated(); |
47 | 52 |
48 // Set a custom background for the view. The background will be tiled. | 53 // Set a custom background for the view. The background will be tiled. |
49 void SetBackground(const SkBitmap& background); | 54 void SetBackground(const SkBitmap& background); |
50 | 55 |
51 // Sets the container for this view. | 56 // Sets the container for this view. |
52 void SetContainer(Container* container) { container_ = container; } | 57 void SetContainer(Container* container) { container_ = container; } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // Note: the view does not own its container. | 103 // Note: the view does not own its container. |
99 Container* container_; | 104 Container* container_; |
100 | 105 |
101 // Whether this extension view is clipped. | 106 // Whether this extension view is clipped. |
102 bool is_clipped_; | 107 bool is_clipped_; |
103 | 108 |
104 DISALLOW_COPY_AND_ASSIGN(ExtensionView); | 109 DISALLOW_COPY_AND_ASSIGN(ExtensionView); |
105 }; | 110 }; |
106 | 111 |
107 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_VIEW_H_ | 112 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_VIEW_H_ |
OLD | NEW |