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_
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"
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
{
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
,
45 double item_font_size
,
47 const std::vector
<WebMenuItem
>& items
,
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
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
) {}
73 virtual ~RenderViewHostDelegateView() {}
76 } // namespace content
78 #endif // CONTENT_PORT_BROWSER_RENDER_VIEW_HOST_DELEGATE_VIEW_H_