OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_VIEWS_NOTIFICATIONS_BALLOON_VIEW_HOST_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_NOTIFICATIONS_BALLOON_VIEW_HOST_H_ |
6 #define CHROME_BROWSER_VIEWS_NOTIFICATIONS_BALLOON_VIEW_HOST_H_ | 6 #define CHROME_BROWSER_VIEWS_NOTIFICATIONS_BALLOON_VIEW_HOST_H_ |
7 | 7 |
8 #include "chrome/browser/notifications/balloon.h" | 8 #include "chrome/browser/notifications/balloon.h" |
9 #include "chrome/browser/notifications/notification.h" | 9 #include "chrome/browser/notifications/notification.h" |
10 #include "chrome/browser/renderer_host/render_view_host_delegate.h" | 10 #include "chrome/browser/renderer_host/render_view_host_delegate.h" |
11 #include "chrome/browser/renderer_host/site_instance.h" | 11 #include "chrome/browser/renderer_host/site_instance.h" |
12 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" | 12 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" |
13 #include "chrome/common/renderer_preferences.h" | 13 #include "chrome/common/renderer_preferences.h" |
14 #include "views/controls/native/native_view_host.h" | 14 #include "views/controls/native/native_view_host.h" |
15 #include "webkit/glue/webpreferences.h" | 15 #include "webkit/glue/webpreferences.h" |
16 | 16 |
17 class Profile; | 17 class Profile; |
18 class RenderViewHost; | 18 class RenderViewHost; |
| 19 class SkBitmap; |
| 20 namespace gfx { |
| 21 class Point; |
| 22 } |
19 | 23 |
20 // BalloonViewHost class is a delegate to the renderer host for the HTML | 24 // BalloonViewHost class is a delegate to the renderer host for the HTML |
21 // notification. When initialized it creates a new RenderViewHost and loads | 25 // notification. When initialized it creates a new RenderViewHost and loads |
22 // the contents of the toast into it. It also handles links within the toast, | 26 // the contents of the toast into it. It also handles links within the toast, |
23 // loading them into a new tab. | 27 // loading them into a new tab. |
24 class BalloonViewHost : public views::NativeViewHost, | 28 class BalloonViewHost : public views::NativeViewHost, |
25 public RenderViewHostDelegate, | 29 public RenderViewHostDelegate, |
26 public RenderViewHostDelegate::View { | 30 public RenderViewHostDelegate::View { |
27 public: | 31 public: |
28 explicit BalloonViewHost(Balloon* balloon); | 32 explicit BalloonViewHost(Balloon* balloon); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 virtual void CreateNewWindow(int route_id); | 68 virtual void CreateNewWindow(int route_id); |
65 virtual void CreateNewWidget(int route_id, bool activatable) {} | 69 virtual void CreateNewWidget(int route_id, bool activatable) {} |
66 virtual void ShowCreatedWindow(int route_id, | 70 virtual void ShowCreatedWindow(int route_id, |
67 WindowOpenDisposition disposition, | 71 WindowOpenDisposition disposition, |
68 const gfx::Rect& initial_pos, | 72 const gfx::Rect& initial_pos, |
69 bool user_gesture); | 73 bool user_gesture); |
70 virtual void ShowCreatedWidget(int route_id, | 74 virtual void ShowCreatedWidget(int route_id, |
71 const gfx::Rect& initial_pos) {} | 75 const gfx::Rect& initial_pos) {} |
72 virtual void ShowContextMenu(const ContextMenuParams& params) {} | 76 virtual void ShowContextMenu(const ContextMenuParams& params) {} |
73 virtual void StartDragging(const WebDropData& drop_data, | 77 virtual void StartDragging(const WebDropData& drop_data, |
74 WebKit::WebDragOperationsMask allowed_ops) {} | 78 WebKit::WebDragOperationsMask allowed_ops, |
| 79 const SkBitmap& image, |
| 80 const gfx::Point& image_offset) {} |
75 virtual void UpdateDragCursor(WebKit::WebDragOperation operation) {} | 81 virtual void UpdateDragCursor(WebKit::WebDragOperation operation) {} |
76 virtual void GotFocus() {} | 82 virtual void GotFocus() {} |
77 virtual void TakeFocus(bool reverse) {} | 83 virtual void TakeFocus(bool reverse) {} |
78 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 84 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
79 bool* is_keyboard_shortcut) { | 85 bool* is_keyboard_shortcut) { |
80 return false; | 86 return false; |
81 } | 87 } |
82 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {} | 88 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {} |
83 virtual void HandleMouseEvent() {} | 89 virtual void HandleMouseEvent() {} |
84 virtual void HandleMouseLeave() {} | 90 virtual void HandleMouseLeave() {} |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // Whether the page we are rendering is from an extension. | 129 // Whether the page we are rendering is from an extension. |
124 bool is_extension_page_; | 130 bool is_extension_page_; |
125 | 131 |
126 // Common implementations of some RenderViewHostDelegate::View methods. | 132 // Common implementations of some RenderViewHostDelegate::View methods. |
127 RenderViewHostDelegateViewHelper delegate_view_helper_; | 133 RenderViewHostDelegateViewHelper delegate_view_helper_; |
128 | 134 |
129 DISALLOW_COPY_AND_ASSIGN(BalloonViewHost); | 135 DISALLOW_COPY_AND_ASSIGN(BalloonViewHost); |
130 }; | 136 }; |
131 | 137 |
132 #endif // CHROME_BROWSER_VIEWS_NOTIFICATIONS_BALLOON_VIEW_HOST_H_ | 138 #endif // CHROME_BROWSER_VIEWS_NOTIFICATIONS_BALLOON_VIEW_HOST_H_ |
OLD | NEW |