| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 int error_code) { | 232 int error_code) { |
| 233 // The |platform_view_| gets destroyed before we get here if this view | 233 // The |platform_view_| gets destroyed before we get here if this view |
| 234 // is for an InterstitialPage. | 234 // is for an InterstitialPage. |
| 235 if (platform_view_) | 235 if (platform_view_) |
| 236 platform_view_->RenderProcessGone(status, error_code); | 236 platform_view_->RenderProcessGone(status, error_code); |
| 237 | 237 |
| 238 RenderWidgetHostViewChildFrame::RenderProcessGone(status, error_code); | 238 RenderWidgetHostViewChildFrame::RenderProcessGone(status, error_code); |
| 239 } | 239 } |
| 240 | 240 |
| 241 void RenderWidgetHostViewGuest::Destroy() { | 241 void RenderWidgetHostViewGuest::Destroy() { |
| 242 RenderWidgetHostViewChildFrame::Destroy(); | |
| 243 | |
| 244 if (platform_view_) // The platform view might have been destroyed already. | 242 if (platform_view_) // The platform view might have been destroyed already. |
| 245 platform_view_->Destroy(); | 243 platform_view_->Destroy(); |
| 244 |
| 245 // RenderWidgetHostViewChildFrame::Destroy destroys this object. |
| 246 RenderWidgetHostViewChildFrame::Destroy(); |
| 246 } | 247 } |
| 247 | 248 |
| 248 gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const { | 249 gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const { |
| 249 // We obtain the reference to native view from the owner RenderWidgetHostView. | 250 // We obtain the reference to native view from the owner RenderWidgetHostView. |
| 250 // If the guest is embedded inside a cross-process frame, it is possible to | 251 // If the guest is embedded inside a cross-process frame, it is possible to |
| 251 // reach here after the frame is detached in which case there will be no owner | 252 // reach here after the frame is detached in which case there will be no owner |
| 252 // view. | 253 // view. |
| 253 if (!GetOwnerRenderWidgetHostView()) | 254 if (!GetOwnerRenderWidgetHostView()) |
| 254 return gfx::Size(); | 255 return gfx::Size(); |
| 255 return RenderWidgetHostViewBase::GetPhysicalBackingSize(); | 256 return RenderWidgetHostViewBase::GetPhysicalBackingSize(); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 gesture_event.data.scrollUpdate.inertialPhase == | 640 gesture_event.data.scrollUpdate.inertialPhase == |
| 640 blink::WebGestureEvent::MomentumPhase) { | 641 blink::WebGestureEvent::MomentumPhase) { |
| 641 return; | 642 return; |
| 642 } | 643 } |
| 643 host_->ForwardGestureEvent(gesture_event); | 644 host_->ForwardGestureEvent(gesture_event); |
| 644 return; | 645 return; |
| 645 } | 646 } |
| 646 } | 647 } |
| 647 | 648 |
| 648 } // namespace content | 649 } // namespace content |
| OLD | NEW |