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