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