| 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_guest.h" | 5 #include "content/browser/frame_host/render_widget_host_view_guest.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 } | 246 } |
| 247 | 247 |
| 248 void RenderWidgetHostViewGuest::Destroy() { | 248 void RenderWidgetHostViewGuest::Destroy() { |
| 249 RenderWidgetHostViewChildFrame::Destroy(); | 249 RenderWidgetHostViewChildFrame::Destroy(); |
| 250 | 250 |
| 251 if (platform_view_) // The platform view might have been destroyed already. | 251 if (platform_view_) // The platform view might have been destroyed already. |
| 252 platform_view_->Destroy(); | 252 platform_view_->Destroy(); |
| 253 } | 253 } |
| 254 | 254 |
| 255 gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const { | 255 gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const { |
| 256 // We obtain the reference to native view from the owner RenderWidgetHostView. |
| 257 // If the guest is embedded inside a cross-process frame, it is possible to |
| 258 // reach here after the frame is detached in which case there will be no owner |
| 259 // view. |
| 260 if (!GetOwnerRenderWidgetHostView()) |
| 261 return gfx::Size(); |
| 256 return RenderWidgetHostViewBase::GetPhysicalBackingSize(); | 262 return RenderWidgetHostViewBase::GetPhysicalBackingSize(); |
| 257 } | 263 } |
| 258 | 264 |
| 259 base::string16 RenderWidgetHostViewGuest::GetSelectedText() { | 265 base::string16 RenderWidgetHostViewGuest::GetSelectedText() { |
| 260 return platform_view_->GetSelectedText(); | 266 return platform_view_->GetSelectedText(); |
| 261 } | 267 } |
| 262 | 268 |
| 263 void RenderWidgetHostViewGuest::SetNeedsBeginFrames( | 269 void RenderWidgetHostViewGuest::SetNeedsBeginFrames( |
| 264 bool needs_begin_frames) { | 270 bool needs_begin_frames) { |
| 265 if (platform_view_) | 271 if (platform_view_) |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 gesture_event.data.scrollUpdate.inertialPhase == | 687 gesture_event.data.scrollUpdate.inertialPhase == |
| 682 blink::WebGestureEvent::MomentumPhase) { | 688 blink::WebGestureEvent::MomentumPhase) { |
| 683 return; | 689 return; |
| 684 } | 690 } |
| 685 host_->ForwardGestureEvent(gesture_event); | 691 host_->ForwardGestureEvent(gesture_event); |
| 686 return; | 692 return; |
| 687 } | 693 } |
| 688 } | 694 } |
| 689 | 695 |
| 690 } // namespace content | 696 } // namespace content |
| OLD | NEW |