1
1
// vim:expandtab:shiftwidth=2:tabstop=2:
2
// Copyright (C) 2014 Canonical Ltd.
2
// Copyright (C) 2014-2015 Canonical Ltd.
4
4
// This library is free software; you can redistribute it and/or
5
5
// modify it under the terms of the GNU Lesser General Public
15
15
// License along with this library; if not, write to the Free Software
16
16
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
#ifndef _OXIDE_SHARED_BROWSER_RENDER_WIDGET_HOST_VIEW_DELEGATE_H_
19
#define _OXIDE_SHARED_BROWSER_RENDER_WIDGET_HOST_VIEW_DELEGATE_H_
18
#ifndef _OXIDE_SHARED_BROWSER_RENDER_WIDGET_HOST_VIEW_CONTAINER_H_
19
#define _OXIDE_SHARED_BROWSER_RENDER_WIDGET_HOST_VIEW_CONTAINER_H_
23
#include "base/memory/ref_counted.h"
24
#include "content/public/common/menu_item.h"
21
25
#include "third_party/WebKit/public/platform/WebScreenInfo.h"
22
#include "ui/base/ime/text_input_type.h"
23
26
#include "ui/gfx/geometry/rect.h"
24
27
#include "ui/gfx/geometry/size.h"
26
33
namespace content {
34
struct ContextMenuParams;
35
class RenderFrameHost;
45
class RenderWidgetHostView;
39
class RenderWidgetHostViewDelegate {
47
class RenderWidgetHostViewContainer {
41
virtual ~RenderWidgetHostViewDelegate() {}
43
virtual void EvictCurrentFrame() = 0;
45
virtual void UpdateCursor(const content::WebCursor& cursor) = 0;
47
virtual void TextInputStateChanged(ui::TextInputType type,
48
bool show_ime_if_needed) = 0;
50
virtual void FocusedNodeChanged(bool is_editable_node) = 0;
52
virtual void ImeCancelComposition() = 0;
54
virtual void SelectionBoundsChanged(const gfx::Rect& caret_rect,
55
size_t selection_cursor_position,
56
size_t selection_anchor_position) = 0;
58
virtual void SelectionChanged() = 0;
49
virtual ~RenderWidgetHostViewContainer() {}
60
51
virtual Compositor* GetCompositor() const = 0;
53
virtual void AttachLayer(scoped_refptr<cc::Layer> layer) = 0;
55
virtual void DetachLayer(scoped_refptr<cc::Layer> layer) = 0;
57
virtual void CursorChanged() = 0;
62
59
virtual gfx::Size GetViewSizePix() const = 0;
64
61
virtual gfx::Rect GetViewBoundsDip() const = 0;
66
63
virtual blink::WebScreenInfo GetScreenInfo() const = 0;
68
virtual bool HasFocus() const = 0;
65
virtual bool HasFocus(const RenderWidgetHostView* view) const = 0;
70
67
virtual bool IsVisible() const = 0;
72
69
virtual float GetLocationBarHeightDip() const = 0;
71
virtual void ShowContextMenu(content::RenderFrameHost* render_frame_host,
72
const content::ContextMenuParams& params) = 0;
74
virtual void ShowPopupMenu(content::RenderFrameHost* render_frame_host,
75
const gfx::Rect& bounds,
77
const std::vector<content::MenuItem>& items,
78
bool allow_multiple_selection) = 0;
79
virtual void HidePopupMenu() = 0;
75
82
} // namespace oxide
77
#endif // _OXIDE_SHARED_BROWSER_RENDER_WIDGET_HOST_VIEW_DELEGATE_H_
84
#endif // _OXIDE_SHARED_BROWSER_RENDER_WIDGET_HOST_VIEW_CONTAINER_H_