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