IndexedDBFactory now ForceCloses databases.
[chromium-blink-merge.git] / content / browser / frame_host / render_widget_host_view_child_frame.h
blob5669c05a6f3b3772f94a55a70a98291e031853ae
1 // Copyright 2014 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_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "content/browser/renderer_host/render_widget_host_view_base.h"
10 #include "content/common/content_export.h"
11 #include "ui/gfx/native_widget_types.h"
12 #include "ui/gfx/rect.h"
14 namespace content {
15 class CrossProcessFrameConnector;
16 class RenderWidgetHost;
17 class RenderWidgetHostImpl;
19 // RenderWidgetHostViewChildFrame implements the view for a RenderWidgetHost
20 // associated with content being rendered in a separate process from
21 // content that is embedding it. This is not a platform-specific class; rather,
22 // the embedding renderer process implements the platform containing the
23 // widget, and the top-level frame's RenderWidgetHostView will ultimately
24 // manage all native widget interaction.
26 // See comments in render_widget_host_view.h about this class and its members.
27 class CONTENT_EXPORT RenderWidgetHostViewChildFrame
28 : public RenderWidgetHostViewBase {
29 public:
30 explicit RenderWidgetHostViewChildFrame(RenderWidgetHost* widget);
31 virtual ~RenderWidgetHostViewChildFrame();
33 void set_cross_process_child_frame(
34 CrossProcessFrameConnector* frame_connector) {
35 frame_connector_ = frame_connector;
38 // RenderWidgetHostView implementation.
39 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE;
40 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE;
41 virtual void SetSize(const gfx::Size& size) OVERRIDE;
42 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE;
43 virtual void Focus() OVERRIDE;
44 virtual bool HasFocus() const OVERRIDE;
45 virtual bool IsSurfaceAvailableForCopy() const OVERRIDE;
46 virtual void Show() OVERRIDE;
47 virtual void Hide() OVERRIDE;
48 virtual bool IsShowing() OVERRIDE;
49 virtual gfx::Rect GetViewBounds() const OVERRIDE;
50 virtual gfx::NativeView GetNativeView() const OVERRIDE;
51 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE;
52 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE;
53 virtual void SetBackground(const SkBitmap& background) OVERRIDE;
54 virtual gfx::Size GetPhysicalBackingSize() const OVERRIDE;
55 #if defined(OS_WIN) && !defined(USE_AURA)
56 virtual void SetClickthroughRegion(SkRegion* region) OVERRIDE;
57 #endif
59 // RenderWidgetHostViewPort implementation.
60 virtual void InitAsPopup(RenderWidgetHostView* parent_host_view,
61 const gfx::Rect& pos) OVERRIDE;
62 virtual void InitAsFullscreen(
63 RenderWidgetHostView* reference_host_view) OVERRIDE;
64 virtual void WasShown() OVERRIDE;
65 virtual void WasHidden() OVERRIDE;
66 virtual void MovePluginWindows(
67 const gfx::Vector2d& scroll_offset,
68 const std::vector<WebPluginGeometry>& moves) OVERRIDE;
69 virtual void Blur() OVERRIDE;
70 virtual void UpdateCursor(const WebCursor& cursor) OVERRIDE;
71 virtual void SetIsLoading(bool is_loading) OVERRIDE;
72 virtual void TextInputTypeChanged(ui::TextInputType type,
73 ui::TextInputMode input_mode,
74 bool can_compose_inline) OVERRIDE;
75 virtual void ImeCancelComposition() OVERRIDE;
76 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_AURA)
77 virtual void ImeCompositionRangeChanged(
78 const gfx::Range& range,
79 const std::vector<gfx::Rect>& character_bounds) OVERRIDE;
80 #endif
81 virtual void DidUpdateBackingStore(
82 const gfx::Rect& scroll_rect,
83 const gfx::Vector2d& scroll_delta,
84 const std::vector<gfx::Rect>& copy_rects,
85 const std::vector<ui::LatencyInfo>& latency_info) OVERRIDE;
86 virtual void RenderProcessGone(base::TerminationStatus status,
87 int error_code) OVERRIDE;
88 virtual void Destroy() OVERRIDE;
89 virtual void SetTooltipText(const base::string16& tooltip_text) OVERRIDE;
90 virtual void SelectionChanged(const base::string16& text,
91 size_t offset,
92 const gfx::Range& range) OVERRIDE;
93 virtual void SelectionBoundsChanged(
94 const ViewHostMsg_SelectionBounds_Params& params) OVERRIDE;
95 virtual void ScrollOffsetChanged() OVERRIDE;
96 virtual BackingStore* AllocBackingStore(const gfx::Size& size) OVERRIDE;
97 virtual void CopyFromCompositingSurface(
98 const gfx::Rect& src_subrect,
99 const gfx::Size& dst_size,
100 const base::Callback<void(bool, const SkBitmap&)>& callback) OVERRIDE;
101 virtual void CopyFromCompositingSurfaceToVideoFrame(
102 const gfx::Rect& src_subrect,
103 const scoped_refptr<media::VideoFrame>& target,
104 const base::Callback<void(bool)>& callback) OVERRIDE;
105 virtual bool CanCopyToVideoFrame() const OVERRIDE;
106 virtual void OnAcceleratedCompositingStateChange() OVERRIDE;
107 virtual void AcceleratedSurfaceInitialized(int host_id,
108 int route_id) OVERRIDE;
109 virtual void AcceleratedSurfaceBuffersSwapped(
110 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
111 int gpu_host_id) OVERRIDE;
112 virtual void AcceleratedSurfacePostSubBuffer(
113 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params,
114 int gpu_host_id) OVERRIDE;
115 virtual void AcceleratedSurfaceSuspend() OVERRIDE;
116 virtual void AcceleratedSurfaceRelease() OVERRIDE;
117 virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE;
118 virtual void OnSwapCompositorFrame(
119 uint32 output_surface_id,
120 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE;
121 virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE;
122 virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE;
123 virtual gfx::GLSurfaceHandle GetCompositingSurface() OVERRIDE;
124 virtual void SetHasHorizontalScrollbar(
125 bool has_horizontal_scrollbar) OVERRIDE;
126 virtual void SetScrollOffsetPinning(
127 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE;
128 #if defined(OS_WIN) || defined(USE_AURA)
129 virtual void ProcessAckedTouchEvent(
130 const TouchEventWithLatencyInfo& touch,
131 InputEventAckState ack_result) OVERRIDE;
132 #endif // defined(OS_WIN) || defined(USE_AURA)
133 virtual bool LockMouse() OVERRIDE;
134 virtual void UnlockMouse() OVERRIDE;
136 #if defined(OS_MACOSX)
137 // RenderWidgetHostView implementation.
138 virtual void SetActive(bool active) OVERRIDE;
139 virtual void SetTakesFocusOnlyOnMouseDown(bool flag) OVERRIDE;
140 virtual void SetWindowVisibility(bool visible) OVERRIDE;
141 virtual void WindowFrameChanged() OVERRIDE;
142 virtual void ShowDefinitionForSelection() OVERRIDE;
143 virtual bool SupportsSpeech() const OVERRIDE;
144 virtual void SpeakSelection() OVERRIDE;
145 virtual bool IsSpeaking() const OVERRIDE;
146 virtual void StopSpeaking() OVERRIDE;
148 // RenderWidgetHostViewPort implementation.
149 virtual bool PostProcessEventForPluginIme(
150 const NativeWebKeyboardEvent& event) OVERRIDE;
151 #endif // defined(OS_MACOSX)
153 #if defined(OS_ANDROID)
154 // RenderWidgetHostViewPort implementation.
155 virtual void ShowDisambiguationPopup(
156 const gfx::Rect& target_rect,
157 const SkBitmap& zoomed_bitmap) OVERRIDE;
158 virtual void HasTouchEventHandlers(bool need_touch_events) OVERRIDE;
159 #endif // defined(OS_ANDROID)
161 #if defined(TOOLKIT_GTK)
162 virtual GdkEventButton* GetLastMouseDown() OVERRIDE;
163 virtual gfx::NativeView BuildInputMethodsGtkMenu() OVERRIDE;
164 #endif // defined(TOOLKIT_GTK)
166 #if defined(OS_WIN) && !defined(USE_AURA)
167 virtual void WillWmDestroy() OVERRIDE;
168 #endif // defined(OS_WIN) && !defined(USE_AURA)
170 #if defined(OS_WIN) && defined(USE_AURA)
171 virtual void SetParentNativeViewAccessible(
172 gfx::NativeViewAccessible accessible_parent) OVERRIDE;
173 virtual gfx::NativeViewId GetParentForWindowlessPlugin() const OVERRIDE;
174 #endif
176 protected:
177 friend class RenderWidgetHostView;
179 // Members will become private when RenderWidgetHostViewGuest is removed.
180 // The model object.
181 RenderWidgetHostImpl* host_;
183 // frame_connector_ provides a platform abstraction. Messages
184 // sent through it are routed to the embedding renderer process.
185 CrossProcessFrameConnector* frame_connector_;
187 gfx::Size size_;
189 private:
190 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame);
193 } // namespace content
195 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_