[content shell] hook up testRunner.dumpEditingCallbacks
[chromium-blink-merge.git] / content / port / browser / render_view_host_delegate_view.h
blob85ef3da1d338bfc725199990df2b47ee0e33767e
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_PORT_BROWSER_RENDER_VIEW_HOST_DELEGATE_VIEW_H_
6 #define CONTENT_PORT_BROWSER_RENDER_VIEW_HOST_DELEGATE_VIEW_H_
8 #include <vector>
10 #include "base/basictypes.h"
11 #include "content/common/content_export.h"
12 #include "content/common/drag_event_source_info.h"
13 #include "content/public/common/context_menu_source_type.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h"
16 class SkBitmap;
17 struct WebDropData;
18 struct WebMenuItem;
20 namespace gfx {
21 class ImageSkia;
22 class Rect;
23 class Vector2d;
26 namespace content {
28 struct ContextMenuParams;
30 // This class provides a way for the RenderViewHost to reach out to its
31 // delegate's view. It only needs to be implemented by embedders if they don't
32 // use the default WebContentsView implementations.
33 class CONTENT_EXPORT RenderViewHostDelegateView {
34 public:
35 // A context menu should be shown, to be built using the context information
36 // provided in the supplied params.
37 virtual void ShowContextMenu(const ContextMenuParams& params,
38 ContextMenuSourceType type) {}
40 // Shows a popup menu with the specified items.
41 // This method should call RenderViewHost::DidSelectPopupMenuItem[s]() or
42 // RenderViewHost::DidCancelPopupMenu() based on the user action.
43 virtual void ShowPopupMenu(const gfx::Rect& bounds,
44 int item_height,
45 double item_font_size,
46 int selected_item,
47 const std::vector<WebMenuItem>& items,
48 bool right_aligned,
49 bool allow_multiple_selection) = 0;
51 // The user started dragging content of the specified type within the
52 // RenderView. Contextual information about the dragged content is supplied
53 // by WebDropData.
54 virtual void StartDragging(const WebDropData& drop_data,
55 WebKit::WebDragOperationsMask allowed_ops,
56 const gfx::ImageSkia& image,
57 const gfx::Vector2d& image_offset,
58 const DragEventSourceInfo& event_info) {}
60 // The page wants to update the mouse cursor during a drag & drop operation.
61 // |operation| describes the current operation (none, move, copy, link.)
62 virtual void UpdateDragCursor(WebKit::WebDragOperation operation) {}
64 // Notification that view for this delegate got the focus.
65 virtual void GotFocus() {}
67 // Callback to inform the browser that the page is returning the focus to
68 // the browser's chrome. If reverse is true, it means the focus was
69 // retrieved by doing a Shift-Tab.
70 virtual void TakeFocus(bool reverse) {}
72 protected:
73 virtual ~RenderViewHostDelegateView() {}
76 } // namespace content
78 #endif // CONTENT_PORT_BROWSER_RENDER_VIEW_HOST_DELEGATE_VIEW_H_