OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 23 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
24 #include "content/browser/compositor/surface_utils.h" | 24 #include "content/browser/compositor/surface_utils.h" |
25 #include "content/browser/frame_host/cross_process_frame_connector.h" | 25 #include "content/browser/frame_host/cross_process_frame_connector.h" |
26 #include "content/browser/gpu/compositor_util.h" | 26 #include "content/browser/gpu/compositor_util.h" |
27 #include "content/browser/renderer_host/render_view_host_impl.h" | 27 #include "content/browser/renderer_host/render_view_host_impl.h" |
28 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 28 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
29 #include "content/browser/renderer_host/render_widget_host_impl.h" | 29 #include "content/browser/renderer_host/render_widget_host_impl.h" |
30 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" | 30 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" |
31 #include "content/common/text_input_state.h" | 31 #include "content/common/text_input_state.h" |
32 #include "content/common/view_messages.h" | 32 #include "content/common/view_messages.h" |
| 33 #include "content/public/browser/guest_mode.h" |
33 #include "content/public/browser/render_process_host.h" | 34 #include "content/public/browser/render_process_host.h" |
34 #include "content/public/common/browser_plugin_guest_mode.h" | 35 #include "content/public/common/browser_plugin_guest_mode.h" |
35 #include "gpu/ipc/common/gpu_messages.h" | 36 #include "gpu/ipc/common/gpu_messages.h" |
36 #include "third_party/WebKit/public/web/WebInputEvent.h" | 37 #include "third_party/WebKit/public/web/WebInputEvent.h" |
37 #include "ui/gfx/geometry/size_conversions.h" | 38 #include "ui/gfx/geometry/size_conversions.h" |
38 #include "ui/gfx/geometry/size_f.h" | 39 #include "ui/gfx/geometry/size_f.h" |
39 | 40 |
40 namespace content { | 41 namespace content { |
41 | 42 |
42 RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame( | 43 RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame( |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 return parent_view->GetVisibleViewportSize(); | 193 return parent_view->GetVisibleViewportSize(); |
193 } | 194 } |
194 return GetViewBounds().size(); | 195 return GetViewBounds().size(); |
195 } | 196 } |
196 | 197 |
197 gfx::Vector2dF RenderWidgetHostViewChildFrame::GetLastScrollOffset() const { | 198 gfx::Vector2dF RenderWidgetHostViewChildFrame::GetLastScrollOffset() const { |
198 return last_scroll_offset_; | 199 return last_scroll_offset_; |
199 } | 200 } |
200 | 201 |
201 gfx::NativeView RenderWidgetHostViewChildFrame::GetNativeView() const { | 202 gfx::NativeView RenderWidgetHostViewChildFrame::GetNativeView() const { |
202 NOTREACHED(); | 203 // TODO(ekaramad): To accomodate MimeHandlerViewGuest while embedded inside |
| 204 // OOPIF-webview, we need to return the native view to be used by |
| 205 // RenderWidgetHostViewGuest. Remove this once https://crbug.com/642826 is |
| 206 // fixed. |
| 207 if (frame_connector_) |
| 208 return frame_connector_->GetParentRenderWidgetHostView()->GetNativeView(); |
203 return nullptr; | 209 return nullptr; |
204 } | 210 } |
205 | 211 |
206 gfx::NativeViewAccessible | 212 gfx::NativeViewAccessible |
207 RenderWidgetHostViewChildFrame::GetNativeViewAccessible() { | 213 RenderWidgetHostViewChildFrame::GetNativeViewAccessible() { |
208 NOTREACHED(); | 214 NOTREACHED(); |
209 return nullptr; | 215 return nullptr; |
210 } | 216 } |
211 | 217 |
212 void RenderWidgetHostViewChildFrame::SetBackgroundColor(SkColor color) { | 218 void RenderWidgetHostViewChildFrame::SetBackgroundColor(SkColor color) { |
(...skipping 28 matching lines...) Expand all Loading... |
241 if (frame_connector_) | 247 if (frame_connector_) |
242 frame_connector_->UpdateCursor(cursor); | 248 frame_connector_->UpdateCursor(cursor); |
243 } | 249 } |
244 | 250 |
245 void RenderWidgetHostViewChildFrame::SetIsLoading(bool is_loading) { | 251 void RenderWidgetHostViewChildFrame::SetIsLoading(bool is_loading) { |
246 // It is valid for an inner WebContents's SetIsLoading() to end up here. | 252 // It is valid for an inner WebContents's SetIsLoading() to end up here. |
247 // This is because an inner WebContents's main frame's RenderWidgetHostView | 253 // This is because an inner WebContents's main frame's RenderWidgetHostView |
248 // is a RenderWidgetHostViewChildFrame. In contrast, when there is no | 254 // is a RenderWidgetHostViewChildFrame. In contrast, when there is no |
249 // inner/outer WebContents, only subframe's RenderWidgetHostView can be a | 255 // inner/outer WebContents, only subframe's RenderWidgetHostView can be a |
250 // RenderWidgetHostViewChildFrame which do not get a SetIsLoading() call. | 256 // RenderWidgetHostViewChildFrame which do not get a SetIsLoading() call. |
251 if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests() && | 257 if (GuestMode::ForInnerWebContentsUsingCrossProcessFrames( |
252 BrowserPluginGuest::IsGuest( | 258 RenderViewHost::From(host_))) |
253 static_cast<RenderViewHostImpl*>(RenderViewHost::From(host_)))) { | |
254 return; | 259 return; |
255 } | |
256 | 260 |
257 NOTREACHED(); | 261 NOTREACHED(); |
258 } | 262 } |
259 | 263 |
260 void RenderWidgetHostViewChildFrame::RenderProcessGone( | 264 void RenderWidgetHostViewChildFrame::RenderProcessGone( |
261 base::TerminationStatus status, | 265 base::TerminationStatus status, |
262 int error_code) { | 266 int error_code) { |
263 if (frame_connector_) | 267 if (frame_connector_) |
264 frame_connector_->RenderProcessGone(); | 268 frame_connector_->RenderProcessGone(); |
265 Destroy(); | 269 Destroy(); |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 | 713 |
710 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { | 714 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { |
711 return true; | 715 return true; |
712 } | 716 } |
713 | 717 |
714 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { | 718 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { |
715 return surface_id_; | 719 return surface_id_; |
716 }; | 720 }; |
717 | 721 |
718 } // namespace content | 722 } // namespace content |
OLD | NEW |