| 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 "gpu/ipc/common/gpu_messages.h" | 35 #include "gpu/ipc/common/gpu_messages.h" |
| 36 #include "third_party/WebKit/public/web/WebInputEvent.h" | 36 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 37 #include "ui/gfx/geometry/size_conversions.h" | 37 #include "ui/gfx/geometry/size_conversions.h" |
| 38 #include "ui/gfx/geometry/size_f.h" | 38 #include "ui/gfx/geometry/size_f.h" |
| 39 | 39 |
| 40 namespace content { | 40 namespace content { |
| 41 | 41 |
| 42 RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame( | 42 RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame( |
| 43 RenderWidgetHost* widget_host) | 43 RenderWidgetHost* widget_host) |
| 44 : host_(RenderWidgetHostImpl::From(widget_host)), | 44 : host_(RenderWidgetHostImpl::From(widget_host)), |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 return parent_view->GetVisibleViewportSize(); | 192 return parent_view->GetVisibleViewportSize(); |
| 193 } | 193 } |
| 194 return GetViewBounds().size(); | 194 return GetViewBounds().size(); |
| 195 } | 195 } |
| 196 | 196 |
| 197 gfx::Vector2dF RenderWidgetHostViewChildFrame::GetLastScrollOffset() const { | 197 gfx::Vector2dF RenderWidgetHostViewChildFrame::GetLastScrollOffset() const { |
| 198 return last_scroll_offset_; | 198 return last_scroll_offset_; |
| 199 } | 199 } |
| 200 | 200 |
| 201 gfx::NativeView RenderWidgetHostViewChildFrame::GetNativeView() const { | 201 gfx::NativeView RenderWidgetHostViewChildFrame::GetNativeView() const { |
| 202 NOTREACHED(); | 202 // TODO(ekaramad): To accomodate MimeHandlerViewGuest while embedded inside |
| 203 // OOPIF-webview, we need to return the native view to be used by |
| 204 // RenderWidgetHostViewGuest. Remove this once https://crbug.com/642826 is |
| 205 // fixed. |
| 206 if (frame_connector_) |
| 207 return frame_connector_->GetParentRenderWidgetHostView()->GetNativeView(); |
| 203 return nullptr; | 208 return nullptr; |
| 204 } | 209 } |
| 205 | 210 |
| 206 gfx::NativeViewAccessible | 211 gfx::NativeViewAccessible |
| 207 RenderWidgetHostViewChildFrame::GetNativeViewAccessible() { | 212 RenderWidgetHostViewChildFrame::GetNativeViewAccessible() { |
| 208 NOTREACHED(); | 213 NOTREACHED(); |
| 209 return nullptr; | 214 return nullptr; |
| 210 } | 215 } |
| 211 | 216 |
| 212 void RenderWidgetHostViewChildFrame::SetBackgroundColor(SkColor color) { | 217 void RenderWidgetHostViewChildFrame::SetBackgroundColor(SkColor color) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 241 if (frame_connector_) | 246 if (frame_connector_) |
| 242 frame_connector_->UpdateCursor(cursor); | 247 frame_connector_->UpdateCursor(cursor); |
| 243 } | 248 } |
| 244 | 249 |
| 245 void RenderWidgetHostViewChildFrame::SetIsLoading(bool is_loading) { | 250 void RenderWidgetHostViewChildFrame::SetIsLoading(bool is_loading) { |
| 246 // It is valid for an inner WebContents's SetIsLoading() to end up here. | 251 // 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 | 252 // This is because an inner WebContents's main frame's RenderWidgetHostView |
| 248 // is a RenderWidgetHostViewChildFrame. In contrast, when there is no | 253 // is a RenderWidgetHostViewChildFrame. In contrast, when there is no |
| 249 // inner/outer WebContents, only subframe's RenderWidgetHostView can be a | 254 // inner/outer WebContents, only subframe's RenderWidgetHostView can be a |
| 250 // RenderWidgetHostViewChildFrame which do not get a SetIsLoading() call. | 255 // RenderWidgetHostViewChildFrame which do not get a SetIsLoading() call. |
| 251 if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests() && | 256 if (GuestMode::IsCrossProcessFrameGuest( |
| 252 BrowserPluginGuest::IsGuest( | 257 WebContents::FromRenderViewHost(RenderViewHost::From(host_)))) |
| 253 static_cast<RenderViewHostImpl*>(RenderViewHost::From(host_)))) { | |
| 254 return; | 258 return; |
| 255 } | |
| 256 | 259 |
| 257 NOTREACHED(); | 260 NOTREACHED(); |
| 258 } | 261 } |
| 259 | 262 |
| 260 void RenderWidgetHostViewChildFrame::RenderProcessGone( | 263 void RenderWidgetHostViewChildFrame::RenderProcessGone( |
| 261 base::TerminationStatus status, | 264 base::TerminationStatus status, |
| 262 int error_code) { | 265 int error_code) { |
| 263 if (frame_connector_) | 266 if (frame_connector_) |
| 264 frame_connector_->RenderProcessGone(); | 267 frame_connector_->RenderProcessGone(); |
| 265 Destroy(); | 268 Destroy(); |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 | 712 |
| 710 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { | 713 bool RenderWidgetHostViewChildFrame::IsChildFrameForTesting() const { |
| 711 return true; | 714 return true; |
| 712 } | 715 } |
| 713 | 716 |
| 714 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { | 717 cc::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { |
| 715 return surface_id_; | 718 return surface_id_; |
| 716 }; | 719 }; |
| 717 | 720 |
| 718 } // namespace content | 721 } // namespace content |
| OLD | NEW |