Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PORT_BROWSER_RENDER_VIEW_HOST_DELEGATE_VIEW_H_ | 5 #ifndef CONTENT_PORT_BROWSER_RENDER_VIEW_HOST_DELEGATE_VIEW_H_ |
| 6 #define CONTENT_PORT_BROWSER_RENDER_VIEW_HOST_DELEGATE_VIEW_H_ | 6 #define CONTENT_PORT_BROWSER_RENDER_VIEW_HOST_DELEGATE_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | |
| 10 | |
| 9 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 10 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" |
| 12 | 14 |
| 13 class SkBitmap; | 15 class SkBitmap; |
| 14 struct WebDropData; | 16 struct WebDropData; |
| 17 struct WebMenuItem; | |
| 15 | 18 |
| 16 namespace gfx { | 19 namespace gfx { |
| 17 class Point; | 20 class Point; |
| 21 class Rect; | |
| 18 } | 22 } |
| 19 | 23 |
| 20 namespace content { | 24 namespace content { |
| 21 | 25 |
| 22 struct ContextMenuParams; | 26 struct ContextMenuParams; |
| 23 | 27 |
| 24 // This class provides a way for the RenderViewHost to reach out to its | 28 // This class provides a way for the RenderViewHost to reach out to its |
| 25 // delegate's view. It only needs to be implemented by embedders if they don't | 29 // delegate's view. It only needs to be implemented by embedders if they don't |
| 26 // use the default WebContentsView implementations. | 30 // use the default WebContentsView implementations. |
| 27 class CONTENT_EXPORT RenderViewHostDelegateView { | 31 class CONTENT_EXPORT RenderViewHostDelegateView { |
| 28 public: | 32 public: |
| 29 // A context menu should be shown, to be built using the context information | 33 // A context menu should be shown, to be built using the context information |
| 30 // provided in the supplied params. | 34 // provided in the supplied params. |
| 31 virtual void ShowContextMenu(const ContextMenuParams& params) {} | 35 virtual void ShowContextMenu(const ContextMenuParams& params) {} |
| 32 | 36 |
| 37 // Shows a popup menu with the specified items. | |
| 38 // This method should call RenderViewHost::DidSelectPopupMenuItemAt() or | |
|
Avi (use Gerrit)
2012/05/24 18:41:41
// This method should call RenderViewHost::DidSele
aruslan
2012/05/24 19:53:15
Done.
| |
| 39 // RenderViewHost::DidCancelPopupMenu() based on the user action. | |
| 40 virtual void ShowPopupMenu(const gfx::Rect& bounds, | |
| 41 int item_height, | |
| 42 double item_font_size, | |
| 43 int selected_item, | |
| 44 const std::vector<WebMenuItem>& items, | |
| 45 bool right_aligned, | |
| 46 bool allow_multiple_selection) = 0; | |
| 47 | |
| 33 // The user started dragging content of the specified type within the | 48 // The user started dragging content of the specified type within the |
| 34 // RenderView. Contextual information about the dragged content is supplied | 49 // RenderView. Contextual information about the dragged content is supplied |
| 35 // by WebDropData. | 50 // by WebDropData. |
| 36 virtual void StartDragging(const WebDropData& drop_data, | 51 virtual void StartDragging(const WebDropData& drop_data, |
| 37 WebKit::WebDragOperationsMask allowed_ops, | 52 WebKit::WebDragOperationsMask allowed_ops, |
| 38 const SkBitmap& image, | 53 const SkBitmap& image, |
| 39 const gfx::Point& image_offset) {} | 54 const gfx::Point& image_offset) {} |
| 40 | 55 |
| 41 // The page wants to update the mouse cursor during a drag & drop operation. | 56 // The page wants to update the mouse cursor during a drag & drop operation. |
| 42 // |operation| describes the current operation (none, move, copy, link.) | 57 // |operation| describes the current operation (none, move, copy, link.) |
| 43 virtual void UpdateDragCursor(WebKit::WebDragOperation operation) {} | 58 virtual void UpdateDragCursor(WebKit::WebDragOperation operation) {} |
| 44 | 59 |
| 45 // Notification that view for this delegate got the focus. | 60 // Notification that view for this delegate got the focus. |
| 46 virtual void GotFocus() {} | 61 virtual void GotFocus() {} |
| 47 | 62 |
| 48 // Callback to inform the browser that the page is returning the focus to | 63 // Callback to inform the browser that the page is returning the focus to |
| 49 // the browser's chrome. If reverse is true, it means the focus was | 64 // the browser's chrome. If reverse is true, it means the focus was |
| 50 // retrieved by doing a Shift-Tab. | 65 // retrieved by doing a Shift-Tab. |
| 51 virtual void TakeFocus(bool reverse) {} | 66 virtual void TakeFocus(bool reverse) {} |
| 52 | 67 |
| 53 protected: | 68 protected: |
| 54 virtual ~RenderViewHostDelegateView() {} | 69 virtual ~RenderViewHostDelegateView() {} |
| 55 }; | 70 }; |
| 56 | 71 |
| 57 } // namespace content | 72 } // namespace content |
| 58 | 73 |
| 59 #endif // CONTENT_PORT_BROWSER_RENDER_VIEW_HOST_DELEGATE_VIEW_H_ | 74 #endif // CONTENT_PORT_BROWSER_RENDER_VIEW_HOST_DELEGATE_VIEW_H_ |
| OLD | NEW |