Add ICU message format support
[chromium-blink-merge.git] / content / browser / renderer_host / render_view_host_delegate_view.h
blob4c2491221bc629c64cbfb1f8535ab3fcf2e8198b
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_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_VIEW_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_VIEW_H_
8 #include <vector>
10 #include "base/basictypes.h"
11 #include "base/callback.h"
12 #include "content/common/content_export.h"
13 #include "content/common/drag_event_source_info.h"
14 #include "third_party/WebKit/public/web/WebDragOperation.h"
16 class SkBitmap;
18 namespace gfx {
19 class ImageSkia;
20 class Rect;
21 class Vector2d;
24 namespace ui {
25 class GestureEvent;
26 class MouseEvent;
29 namespace content {
30 class RenderFrameHost;
31 struct ContextMenuParams;
32 struct DropData;
33 struct MenuItem;
35 // This class provides a way for the RenderViewHost to reach out to its
36 // delegate's view. It only needs to be implemented by embedders if they don't
37 // use the default WebContentsView implementations.
38 class CONTENT_EXPORT RenderViewHostDelegateView {
39 public:
40 // A context menu should be shown, to be built using the context information
41 // provided in the supplied params.
42 virtual void ShowContextMenu(RenderFrameHost* render_frame_host,
43 const ContextMenuParams& params) {}
45 // The user started dragging content of the specified type within the
46 // RenderView. Contextual information about the dragged content is supplied
47 // by DropData. If the delegate's view cannot start the drag for /any/
48 // reason, it must inform the renderer that the drag has ended; otherwise,
49 // this results in bugs like http://crbug.com/157134.
50 virtual void StartDragging(const DropData& drop_data,
51 blink::WebDragOperationsMask allowed_ops,
52 const gfx::ImageSkia& image,
53 const gfx::Vector2d& image_offset,
54 const DragEventSourceInfo& event_info) {}
56 // The page wants to update the mouse cursor during a drag & drop operation.
57 // |operation| describes the current operation (none, move, copy, link.)
58 virtual void UpdateDragCursor(blink::WebDragOperation operation) {}
60 // Notification that view for this delegate got the focus.
61 virtual void GotFocus() {}
63 // Callback to inform the browser that the page is returning the focus to
64 // the browser's chrome. If reverse is true, it means the focus was
65 // retrieved by doing a Shift-Tab.
66 virtual void TakeFocus(bool reverse) {}
68 #if defined(OS_MACOSX) || defined(OS_ANDROID)
69 // Shows a popup menu with the specified items.
70 // This method should call RenderFrameHost::DidSelectPopupMenuItem[s]() or
71 // RenderFrameHost::DidCancelPopupMenu() based on the user action.
72 virtual void ShowPopupMenu(RenderFrameHost* render_frame_host,
73 const gfx::Rect& bounds,
74 int item_height,
75 double item_font_size,
76 int selected_item,
77 const std::vector<MenuItem>& items,
78 bool right_aligned,
79 bool allow_multiple_selection) {};
81 // Hides a popup menu opened by ShowPopupMenu().
82 virtual void HidePopupMenu() {};
83 #endif
85 #if defined(USE_AURA)
86 // Shows a Link Disambiguation Popup. |target_rect| is the area the user
87 // touched that resulted in ambiguity, in DIPs in the host's coordinate
88 // system, |zoomed_bitmap| is an enlarged image of that |target_rect|, and
89 // |callback| is for forwarding on to the original scale web content.
90 virtual void ShowDisambiguationPopup(
91 const gfx::Rect& target_rect,
92 const SkBitmap& zoomed_bitmap,
93 const base::Callback<void(ui::GestureEvent*)>& gesture_cb,
94 const base::Callback<void(ui::MouseEvent*)>& mouse_cb) {}
96 // Hides the Link Disambiguation Popup, if it was showing, otherwise does
97 // nothing.
98 virtual void HideDisambiguationPopup() {}
99 #endif
101 protected:
102 virtual ~RenderViewHostDelegateView() {}
105 } // namespace content
107 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_VIEW_H_