Remove PlatformFile from profile_browsertest
[chromium-blink-merge.git] / content / browser / frame_host / render_widget_host_view_child_frame.cc
blob14e52b24f232e12abcef4714e7971aab3599852c
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 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
7 #include "content/browser/frame_host/cross_process_frame_connector.h"
8 #include "content/browser/renderer_host/render_widget_host_impl.h"
9 #include "content/common/gpu/gpu_messages.h"
10 #include "content/common/view_messages.h"
11 #include "content/public/browser/render_process_host.h"
13 namespace content {
15 RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame(
16 RenderWidgetHost* widget_host)
17 : host_(RenderWidgetHostImpl::From(widget_host)),
18 frame_connector_(NULL) {
19 host_->SetView(this);
22 RenderWidgetHostViewChildFrame::~RenderWidgetHostViewChildFrame() {
25 void RenderWidgetHostViewChildFrame::InitAsChild(
26 gfx::NativeView parent_view) {
27 NOTREACHED();
30 RenderWidgetHost* RenderWidgetHostViewChildFrame::GetRenderWidgetHost() const {
31 return host_;
34 void RenderWidgetHostViewChildFrame::SetSize(const gfx::Size& size) {
35 host_->WasResized();
38 void RenderWidgetHostViewChildFrame::SetBounds(const gfx::Rect& rect) {
39 SetSize(rect.size());
42 void RenderWidgetHostViewChildFrame::Focus() {
45 bool RenderWidgetHostViewChildFrame::HasFocus() const {
46 return false;
49 bool RenderWidgetHostViewChildFrame::IsSurfaceAvailableForCopy() const {
50 NOTIMPLEMENTED();
51 return false;
54 void RenderWidgetHostViewChildFrame::Show() {
55 WasShown();
58 void RenderWidgetHostViewChildFrame::Hide() {
59 WasHidden();
62 bool RenderWidgetHostViewChildFrame::IsShowing() {
63 return !host_->is_hidden();
66 gfx::Rect RenderWidgetHostViewChildFrame::GetViewBounds() const {
67 gfx::Rect rect;
68 if (frame_connector_)
69 rect = frame_connector_->ChildFrameRect();
70 return rect;
73 gfx::NativeView RenderWidgetHostViewChildFrame::GetNativeView() const {
74 NOTREACHED();
75 return NULL;
78 gfx::NativeViewId RenderWidgetHostViewChildFrame::GetNativeViewId() const {
79 NOTREACHED();
80 return 0;
83 gfx::NativeViewAccessible
84 RenderWidgetHostViewChildFrame::GetNativeViewAccessible() {
85 NOTREACHED();
86 return NULL;
89 void RenderWidgetHostViewChildFrame::SetBackground(
90 const SkBitmap& background) {
93 gfx::Size RenderWidgetHostViewChildFrame::GetPhysicalBackingSize() const {
94 gfx::Size size;
95 if (frame_connector_)
96 size = frame_connector_->ChildFrameRect().size();
97 return size;
100 void RenderWidgetHostViewChildFrame::InitAsPopup(
101 RenderWidgetHostView* parent_host_view,
102 const gfx::Rect& pos) {
103 NOTREACHED();
106 void RenderWidgetHostViewChildFrame::InitAsFullscreen(
107 RenderWidgetHostView* reference_host_view) {
108 NOTREACHED();
111 void RenderWidgetHostViewChildFrame::ImeCancelComposition() {
112 NOTREACHED();
115 #if defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_AURA)
116 void RenderWidgetHostViewChildFrame::ImeCompositionRangeChanged(
117 const gfx::Range& range,
118 const std::vector<gfx::Rect>& character_bounds) {
119 NOTREACHED();
121 #endif
123 void RenderWidgetHostViewChildFrame::DidUpdateBackingStore(
124 const gfx::Rect& scroll_rect,
125 const gfx::Vector2d& scroll_delta,
126 const std::vector<gfx::Rect>& copy_rects,
127 const std::vector<ui::LatencyInfo>& latency_info) {
128 NOTREACHED();
131 void RenderWidgetHostViewChildFrame::WasShown() {
132 if (!host_->is_hidden())
133 return;
134 host_->WasShown();
137 void RenderWidgetHostViewChildFrame::WasHidden() {
138 if (host_->is_hidden())
139 return;
140 host_->WasHidden();
143 void RenderWidgetHostViewChildFrame::MovePluginWindows(
144 const gfx::Vector2d& scroll_offset,
145 const std::vector<WebPluginGeometry>& moves) {
148 void RenderWidgetHostViewChildFrame::Blur() {
151 void RenderWidgetHostViewChildFrame::UpdateCursor(const WebCursor& cursor) {
154 void RenderWidgetHostViewChildFrame::SetIsLoading(bool is_loading) {
155 NOTREACHED();
158 void RenderWidgetHostViewChildFrame::TextInputTypeChanged(
159 ui::TextInputType type,
160 ui::TextInputMode input_mode,
161 bool can_compose_inline) {
162 NOTREACHED();
165 void RenderWidgetHostViewChildFrame::RenderProcessGone(
166 base::TerminationStatus status,
167 int error_code) {
168 if (frame_connector_)
169 frame_connector_->RenderProcessGone();
170 Destroy();
173 void RenderWidgetHostViewChildFrame::Destroy() {
174 if (frame_connector_) {
175 frame_connector_->set_view(NULL);
176 frame_connector_ = NULL;
179 host_->SetView(NULL);
180 host_ = NULL;
181 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
184 void RenderWidgetHostViewChildFrame::SetTooltipText(
185 const base::string16& tooltip_text) {
188 void RenderWidgetHostViewChildFrame::SelectionChanged(
189 const base::string16& text,
190 size_t offset,
191 const gfx::Range& range) {
194 void RenderWidgetHostViewChildFrame::SelectionBoundsChanged(
195 const ViewHostMsg_SelectionBounds_Params& params) {
198 #if defined(OS_ANDROID)
199 void RenderWidgetHostViewChildFrame::SelectionRootBoundsChanged(
200 const gfx::Rect& bounds) {
202 #endif
204 void RenderWidgetHostViewChildFrame::ScrollOffsetChanged() {
207 void RenderWidgetHostViewChildFrame::OnAcceleratedCompositingStateChange() {
210 void RenderWidgetHostViewChildFrame::AcceleratedSurfaceInitialized(int host_id,
211 int route_id) {
214 void RenderWidgetHostViewChildFrame::AcceleratedSurfaceBuffersSwapped(
215 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
216 int gpu_host_id) {
217 if (frame_connector_)
218 frame_connector_->ChildFrameBuffersSwapped(params, gpu_host_id);
221 void RenderWidgetHostViewChildFrame::AcceleratedSurfacePostSubBuffer(
222 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params,
223 int gpu_host_id) {
226 void RenderWidgetHostViewChildFrame::OnSwapCompositorFrame(
227 uint32 output_surface_id,
228 scoped_ptr<cc::CompositorFrame> frame) {
229 if (frame_connector_) {
230 frame_connector_->ChildFrameCompositorFrameSwapped(
231 output_surface_id,
232 host_->GetProcess()->GetID(),
233 host_->GetRoutingID(),
234 frame.Pass());
238 void RenderWidgetHostViewChildFrame::GetScreenInfo(
239 blink::WebScreenInfo* results) {
242 gfx::Rect RenderWidgetHostViewChildFrame::GetBoundsInRootWindow() {
243 // We do not have any root window specific parts in this view.
244 return GetViewBounds();
247 #if defined(OS_WIN) || defined(USE_AURA)
248 void RenderWidgetHostViewChildFrame::ProcessAckedTouchEvent(
249 const TouchEventWithLatencyInfo& touch,
250 InputEventAckState ack_result) {
252 #endif // defined(OS_WIN) || defined(USE_AURA)
254 bool RenderWidgetHostViewChildFrame::LockMouse() {
255 return false;
258 void RenderWidgetHostViewChildFrame::UnlockMouse() {
261 #if defined(OS_MACOSX)
262 void RenderWidgetHostViewChildFrame::SetActive(bool active) {
265 void RenderWidgetHostViewChildFrame::SetTakesFocusOnlyOnMouseDown(bool flag) {
268 void RenderWidgetHostViewChildFrame::SetWindowVisibility(bool visible) {
271 void RenderWidgetHostViewChildFrame::WindowFrameChanged() {
274 void RenderWidgetHostViewChildFrame::ShowDefinitionForSelection() {
277 bool RenderWidgetHostViewChildFrame::SupportsSpeech() const {
278 return false;
281 void RenderWidgetHostViewChildFrame::SpeakSelection() {
284 bool RenderWidgetHostViewChildFrame::IsSpeaking() const {
285 return false;
288 void RenderWidgetHostViewChildFrame::StopSpeaking() {
291 bool RenderWidgetHostViewChildFrame::PostProcessEventForPluginIme(
292 const NativeWebKeyboardEvent& event) {
293 return false;
295 #endif // defined(OS_MACOSX)
297 #if defined(OS_ANDROID)
298 void RenderWidgetHostViewChildFrame::ShowDisambiguationPopup(
299 const gfx::Rect& target_rect,
300 const SkBitmap& zoomed_bitmap) {
302 #endif // defined(OS_ANDROID)
304 #if defined(TOOLKIT_GTK)
305 GdkEventButton* RenderWidgetHostViewChildFrame::GetLastMouseDown() {
306 return NULL;
309 gfx::NativeView RenderWidgetHostViewChildFrame::BuildInputMethodsGtkMenu() {
310 return NULL;
312 #endif // defined(TOOLKIT_GTK)
314 BackingStore* RenderWidgetHostViewChildFrame::AllocBackingStore(
315 const gfx::Size& size) {
316 NOTREACHED();
317 return NULL;
320 void RenderWidgetHostViewChildFrame::CopyFromCompositingSurface(
321 const gfx::Rect& src_subrect,
322 const gfx::Size& /* dst_size */,
323 const base::Callback<void(bool, const SkBitmap&)>& callback,
324 const SkBitmap::Config config) {
325 callback.Run(false, SkBitmap());
328 void RenderWidgetHostViewChildFrame::CopyFromCompositingSurfaceToVideoFrame(
329 const gfx::Rect& src_subrect,
330 const scoped_refptr<media::VideoFrame>& target,
331 const base::Callback<void(bool)>& callback) {
332 NOTIMPLEMENTED();
333 callback.Run(false);
336 bool RenderWidgetHostViewChildFrame::CanCopyToVideoFrame() const {
337 return false;
340 void RenderWidgetHostViewChildFrame::AcceleratedSurfaceSuspend() {
341 NOTREACHED();
344 void RenderWidgetHostViewChildFrame::AcceleratedSurfaceRelease() {
347 bool RenderWidgetHostViewChildFrame::HasAcceleratedSurface(
348 const gfx::Size& desired_size) {
349 return false;
352 gfx::GLSurfaceHandle RenderWidgetHostViewChildFrame::GetCompositingSurface() {
353 return gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT);
356 void RenderWidgetHostViewChildFrame::SetHasHorizontalScrollbar(
357 bool has_horizontal_scrollbar) {
360 void RenderWidgetHostViewChildFrame::SetScrollOffsetPinning(
361 bool is_pinned_to_left, bool is_pinned_to_right) {
364 #if defined(OS_WIN)
365 void RenderWidgetHostViewChildFrame::SetParentNativeViewAccessible(
366 gfx::NativeViewAccessible accessible_parent) {
369 gfx::NativeViewId RenderWidgetHostViewChildFrame::GetParentForWindowlessPlugin()
370 const {
371 return NULL;
373 #endif // defined(OS_WIN)
375 SkBitmap::Config RenderWidgetHostViewChildFrame::PreferredReadbackFormat() {
376 return SkBitmap::kARGB_8888_Config;
379 } // namespace content