Implement SSLKEYLOGFILE for OpenSSL.
[chromium-blink-merge.git] / content / browser / frame_host / render_widget_host_view_child_frame.cc
blobd92f66aa85be3b48cd86c03d88f1c6db51738f7c
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/accessibility/browser_accessibility_manager.h"
8 #include "content/browser/frame_host/cross_process_frame_connector.h"
9 #include "content/browser/renderer_host/render_widget_host_impl.h"
10 #include "content/common/gpu/gpu_messages.h"
11 #include "content/common/view_messages.h"
12 #include "content/public/browser/render_process_host.h"
14 namespace content {
16 RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame(
17 RenderWidgetHost* widget_host)
18 : host_(RenderWidgetHostImpl::From(widget_host)),
19 frame_connector_(NULL) {
20 host_->SetView(this);
23 RenderWidgetHostViewChildFrame::~RenderWidgetHostViewChildFrame() {
26 void RenderWidgetHostViewChildFrame::InitAsChild(
27 gfx::NativeView parent_view) {
28 NOTREACHED();
31 RenderWidgetHost* RenderWidgetHostViewChildFrame::GetRenderWidgetHost() const {
32 return host_;
35 void RenderWidgetHostViewChildFrame::SetSize(const gfx::Size& size) {
36 host_->WasResized();
39 void RenderWidgetHostViewChildFrame::SetBounds(const gfx::Rect& rect) {
40 SetSize(rect.size());
43 void RenderWidgetHostViewChildFrame::Focus() {
46 bool RenderWidgetHostViewChildFrame::HasFocus() const {
47 return false;
50 bool RenderWidgetHostViewChildFrame::IsSurfaceAvailableForCopy() const {
51 NOTIMPLEMENTED();
52 return false;
55 void RenderWidgetHostViewChildFrame::Show() {
56 WasShown();
59 void RenderWidgetHostViewChildFrame::Hide() {
60 WasHidden();
63 bool RenderWidgetHostViewChildFrame::IsShowing() {
64 return !host_->is_hidden();
67 gfx::Rect RenderWidgetHostViewChildFrame::GetViewBounds() const {
68 gfx::Rect rect;
69 if (frame_connector_)
70 rect = frame_connector_->ChildFrameRect();
71 return rect;
74 gfx::Vector2dF RenderWidgetHostViewChildFrame::GetLastScrollOffset() const {
75 return last_scroll_offset_;
78 gfx::NativeView RenderWidgetHostViewChildFrame::GetNativeView() const {
79 NOTREACHED();
80 return NULL;
83 gfx::NativeViewId RenderWidgetHostViewChildFrame::GetNativeViewId() const {
84 NOTREACHED();
85 return 0;
88 gfx::NativeViewAccessible
89 RenderWidgetHostViewChildFrame::GetNativeViewAccessible() {
90 NOTREACHED();
91 return NULL;
94 void RenderWidgetHostViewChildFrame::SetBackgroundOpaque(bool opaque) {
97 gfx::Size RenderWidgetHostViewChildFrame::GetPhysicalBackingSize() const {
98 gfx::Size size;
99 if (frame_connector_)
100 size = frame_connector_->ChildFrameRect().size();
101 return size;
104 void RenderWidgetHostViewChildFrame::InitAsPopup(
105 RenderWidgetHostView* parent_host_view,
106 const gfx::Rect& pos) {
107 NOTREACHED();
110 void RenderWidgetHostViewChildFrame::InitAsFullscreen(
111 RenderWidgetHostView* reference_host_view) {
112 NOTREACHED();
115 void RenderWidgetHostViewChildFrame::ImeCancelComposition() {
116 NOTREACHED();
119 #if defined(OS_MACOSX) || defined(USE_AURA)
120 void RenderWidgetHostViewChildFrame::ImeCompositionRangeChanged(
121 const gfx::Range& range,
122 const std::vector<gfx::Rect>& character_bounds) {
123 NOTREACHED();
125 #endif
127 void RenderWidgetHostViewChildFrame::WasShown() {
128 if (!host_->is_hidden())
129 return;
130 host_->WasShown(ui::LatencyInfo());
133 void RenderWidgetHostViewChildFrame::WasHidden() {
134 if (host_->is_hidden())
135 return;
136 host_->WasHidden();
139 void RenderWidgetHostViewChildFrame::MovePluginWindows(
140 const std::vector<WebPluginGeometry>& moves) {
143 void RenderWidgetHostViewChildFrame::Blur() {
146 void RenderWidgetHostViewChildFrame::UpdateCursor(const WebCursor& cursor) {
149 void RenderWidgetHostViewChildFrame::SetIsLoading(bool is_loading) {
150 NOTREACHED();
153 void RenderWidgetHostViewChildFrame::TextInputStateChanged(
154 const ViewHostMsg_TextInputState_Params& params) {
157 void RenderWidgetHostViewChildFrame::RenderProcessGone(
158 base::TerminationStatus status,
159 int error_code) {
160 if (frame_connector_)
161 frame_connector_->RenderProcessGone();
162 Destroy();
165 void RenderWidgetHostViewChildFrame::Destroy() {
166 if (frame_connector_) {
167 frame_connector_->set_view(NULL);
168 frame_connector_ = NULL;
171 host_->SetView(NULL);
172 host_ = NULL;
173 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
176 void RenderWidgetHostViewChildFrame::SetTooltipText(
177 const base::string16& tooltip_text) {
180 void RenderWidgetHostViewChildFrame::SelectionChanged(
181 const base::string16& text,
182 size_t offset,
183 const gfx::Range& range) {
186 void RenderWidgetHostViewChildFrame::SelectionBoundsChanged(
187 const ViewHostMsg_SelectionBounds_Params& params) {
190 #if defined(OS_ANDROID)
191 void RenderWidgetHostViewChildFrame::ShowDisambiguationPopup(
192 const gfx::Rect& target_rect,
193 const SkBitmap& zoomed_bitmap) {
196 void RenderWidgetHostViewChildFrame::LockCompositingSurface() {
199 void RenderWidgetHostViewChildFrame::UnlockCompositingSurface() {
201 #endif
203 void RenderWidgetHostViewChildFrame::AcceleratedSurfaceInitialized(int host_id,
204 int route_id) {
207 void RenderWidgetHostViewChildFrame::AcceleratedSurfaceBuffersSwapped(
208 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params,
209 int gpu_host_id) {
210 if (frame_connector_)
211 frame_connector_->ChildFrameBuffersSwapped(params, gpu_host_id);
214 void RenderWidgetHostViewChildFrame::AcceleratedSurfacePostSubBuffer(
215 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params,
216 int gpu_host_id) {
219 void RenderWidgetHostViewChildFrame::OnSwapCompositorFrame(
220 uint32 output_surface_id,
221 scoped_ptr<cc::CompositorFrame> frame) {
222 last_scroll_offset_ = frame->metadata.root_scroll_offset;
223 if (frame_connector_) {
224 frame_connector_->ChildFrameCompositorFrameSwapped(
225 output_surface_id,
226 host_->GetProcess()->GetID(),
227 host_->GetRoutingID(),
228 frame.Pass());
232 void RenderWidgetHostViewChildFrame::GetScreenInfo(
233 blink::WebScreenInfo* results) {
236 gfx::Rect RenderWidgetHostViewChildFrame::GetBoundsInRootWindow() {
237 // We do not have any root window specific parts in this view.
238 return GetViewBounds();
241 #if defined(USE_AURA)
242 void RenderWidgetHostViewChildFrame::ProcessAckedTouchEvent(
243 const TouchEventWithLatencyInfo& touch,
244 InputEventAckState ack_result) {
246 #endif // defined(USE_AURA)
248 bool RenderWidgetHostViewChildFrame::LockMouse() {
249 return false;
252 void RenderWidgetHostViewChildFrame::UnlockMouse() {
255 #if defined(OS_MACOSX)
256 void RenderWidgetHostViewChildFrame::SetActive(bool active) {
259 void RenderWidgetHostViewChildFrame::SetTakesFocusOnlyOnMouseDown(bool flag) {
262 void RenderWidgetHostViewChildFrame::SetWindowVisibility(bool visible) {
265 void RenderWidgetHostViewChildFrame::WindowFrameChanged() {
268 void RenderWidgetHostViewChildFrame::ShowDefinitionForSelection() {
271 bool RenderWidgetHostViewChildFrame::SupportsSpeech() const {
272 return false;
275 void RenderWidgetHostViewChildFrame::SpeakSelection() {
278 bool RenderWidgetHostViewChildFrame::IsSpeaking() const {
279 return false;
282 void RenderWidgetHostViewChildFrame::StopSpeaking() {
285 bool RenderWidgetHostViewChildFrame::PostProcessEventForPluginIme(
286 const NativeWebKeyboardEvent& event) {
287 return false;
289 #endif // defined(OS_MACOSX)
291 void RenderWidgetHostViewChildFrame::CopyFromCompositingSurface(
292 const gfx::Rect& src_subrect,
293 const gfx::Size& /* dst_size */,
294 const base::Callback<void(bool, const SkBitmap&)>& callback,
295 const SkColorType color_type) {
296 callback.Run(false, SkBitmap());
299 void RenderWidgetHostViewChildFrame::CopyFromCompositingSurfaceToVideoFrame(
300 const gfx::Rect& src_subrect,
301 const scoped_refptr<media::VideoFrame>& target,
302 const base::Callback<void(bool)>& callback) {
303 NOTIMPLEMENTED();
304 callback.Run(false);
307 bool RenderWidgetHostViewChildFrame::CanCopyToVideoFrame() const {
308 return false;
311 void RenderWidgetHostViewChildFrame::AcceleratedSurfaceSuspend() {
312 NOTREACHED();
315 void RenderWidgetHostViewChildFrame::AcceleratedSurfaceRelease() {
318 bool RenderWidgetHostViewChildFrame::HasAcceleratedSurface(
319 const gfx::Size& desired_size) {
320 return false;
323 gfx::GLSurfaceHandle RenderWidgetHostViewChildFrame::GetCompositingSurface() {
324 return gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT);
327 #if defined(OS_WIN)
328 void RenderWidgetHostViewChildFrame::SetParentNativeViewAccessible(
329 gfx::NativeViewAccessible accessible_parent) {
332 gfx::NativeViewId RenderWidgetHostViewChildFrame::GetParentForWindowlessPlugin()
333 const {
334 return NULL;
336 #endif // defined(OS_WIN)
338 SkColorType RenderWidgetHostViewChildFrame::PreferredReadbackFormat() {
339 return kN32_SkColorType;
342 BrowserAccessibilityManager*
343 RenderWidgetHostViewChildFrame::CreateBrowserAccessibilityManager(
344 BrowserAccessibilityDelegate* delegate) {
345 return BrowserAccessibilityManager::Create(
346 BrowserAccessibilityManager::GetEmptyDocument(), delegate);
349 } // namespace content