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_COCOA_NOTIFICATIONS_BALLOON_VIEW_HOST_MAC_H_ | 5 #ifndef CHROME_BROWSER_COCOA_NOTIFICATIONS_BALLOON_VIEW_HOST_MAC_H_ |
6 #define CHROME_BROWSER_COCOA_NOTIFICATIONS_BALLOON_VIEW_HOST_MAC_H_ | 6 #define CHROME_BROWSER_COCOA_NOTIFICATIONS_BALLOON_VIEW_HOST_MAC_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 #import "chrome/browser/renderer_host/render_widget_host_view_mac.h" | 11 #import "chrome/browser/renderer_host/render_widget_host_view_mac.h" |
12 #include "chrome/browser/renderer_host/site_instance.h" | 12 #include "chrome/browser/renderer_host/site_instance.h" |
13 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" | 13 #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" |
14 #include "gfx/native_widget_types.h" | 14 #include "gfx/native_widget_types.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 RenderViewHostDelegate, | 28 class BalloonViewHost : public RenderViewHostDelegate, |
25 public RenderViewHostDelegate::View { | 29 public RenderViewHostDelegate::View { |
26 public: | 30 public: |
27 explicit BalloonViewHost(Balloon* balloon); | 31 explicit BalloonViewHost(Balloon* balloon); |
28 | 32 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 virtual void CreateNewWindow(int route_id); | 74 virtual void CreateNewWindow(int route_id); |
71 virtual void CreateNewWidget(int route_id, bool activatable) {} | 75 virtual void CreateNewWidget(int route_id, bool activatable) {} |
72 virtual void ShowCreatedWindow(int route_id, | 76 virtual void ShowCreatedWindow(int route_id, |
73 WindowOpenDisposition disposition, | 77 WindowOpenDisposition disposition, |
74 const gfx::Rect& initial_pos, | 78 const gfx::Rect& initial_pos, |
75 bool user_gesture); | 79 bool user_gesture); |
76 virtual void ShowCreatedWidget(int route_id, | 80 virtual void ShowCreatedWidget(int route_id, |
77 const gfx::Rect& initial_pos) {} | 81 const gfx::Rect& initial_pos) {} |
78 virtual void ShowContextMenu(const ContextMenuParams& params) {} | 82 virtual void ShowContextMenu(const ContextMenuParams& params) {} |
79 virtual void StartDragging(const WebDropData& drop_data, | 83 virtual void StartDragging(const WebDropData& drop_data, |
80 WebKit::WebDragOperationsMask allowed_ops) {} | 84 WebKit::WebDragOperationsMask allowed_ops, |
| 85 const SkBitmap& image, |
| 86 const gfx::Point& image_offset) {} |
81 virtual void UpdateDragCursor(WebKit::WebDragOperation operation) {} | 87 virtual void UpdateDragCursor(WebKit::WebDragOperation operation) {} |
82 virtual void GotFocus() {} | 88 virtual void GotFocus() {} |
83 virtual void TakeFocus(bool reverse) {} | 89 virtual void TakeFocus(bool reverse) {} |
84 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, | 90 virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event, |
85 bool* is_keyboard_shortcut) { | 91 bool* is_keyboard_shortcut) { |
86 return false; | 92 return false; |
87 } | 93 } |
88 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {} | 94 virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {} |
89 virtual void HandleMouseEvent() {} | 95 virtual void HandleMouseEvent() {} |
90 virtual void HandleMouseLeave() {} | 96 virtual void HandleMouseLeave() {} |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // which this class frees in its destructor. | 128 // which this class frees in its destructor. |
123 RenderWidgetHostViewMac* render_widget_host_view_; | 129 RenderWidgetHostViewMac* render_widget_host_view_; |
124 | 130 |
125 // Common implementations of some RenderViewHostDelegate::View methods. | 131 // Common implementations of some RenderViewHostDelegate::View methods. |
126 RenderViewHostDelegateViewHelper delegate_view_helper_; | 132 RenderViewHostDelegateViewHelper delegate_view_helper_; |
127 | 133 |
128 DISALLOW_COPY_AND_ASSIGN(BalloonViewHost); | 134 DISALLOW_COPY_AND_ASSIGN(BalloonViewHost); |
129 }; | 135 }; |
130 | 136 |
131 #endif // CHROME_BROWSER_COCOA_NOTIFICATIONS_BALLOON_VIEW_HOST_MAC_H_ | 137 #endif // CHROME_BROWSER_COCOA_NOTIFICATIONS_BALLOON_VIEW_HOST_MAC_H_ |
OLD | NEW |