| 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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 } | 384 } |
| 385 } | 385 } |
| 386 | 386 |
| 387 void RenderWidgetHostViewChildFrame::UpdateViewportIntersection( | 387 void RenderWidgetHostViewChildFrame::UpdateViewportIntersection( |
| 388 const gfx::Rect& viewport_intersection) { | 388 const gfx::Rect& viewport_intersection) { |
| 389 if (host_) | 389 if (host_) |
| 390 host_->Send(new ViewMsg_SetViewportIntersection(host_->GetRoutingID(), | 390 host_->Send(new ViewMsg_SetViewportIntersection(host_->GetRoutingID(), |
| 391 viewport_intersection)); | 391 viewport_intersection)); |
| 392 } | 392 } |
| 393 | 393 |
| 394 void RenderWidgetHostViewChildFrame::SetIsInert() { |
| 395 if (host_ && frame_connector_) { |
| 396 host_->Send(new ViewMsg_SetIsInert(host_->GetRoutingID(), |
| 397 frame_connector_->is_inert())); |
| 398 } |
| 399 } |
| 400 |
| 394 void RenderWidgetHostViewChildFrame::GestureEventAck( | 401 void RenderWidgetHostViewChildFrame::GestureEventAck( |
| 395 const blink::WebGestureEvent& event, | 402 const blink::WebGestureEvent& event, |
| 396 InputEventAckState ack_result) { | 403 InputEventAckState ack_result) { |
| 397 bool not_consumed = ack_result == INPUT_EVENT_ACK_STATE_NOT_CONSUMED || | 404 bool not_consumed = ack_result == INPUT_EVENT_ACK_STATE_NOT_CONSUMED || |
| 398 ack_result == INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; | 405 ack_result == INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
| 399 // GestureScrollBegin is consumed by the target frame and not forwarded, | 406 // GestureScrollBegin is consumed by the target frame and not forwarded, |
| 400 // because we don't know whether we will need to bubble scroll until we | 407 // because we don't know whether we will need to bubble scroll until we |
| 401 // receive a GestureScrollUpdate ACK. GestureScrollUpdate with unused | 408 // receive a GestureScrollUpdate ACK. GestureScrollUpdate with unused |
| 402 // scroll extent is forwarded for bubbling, while GestureScrollEnd is | 409 // scroll extent is forwarded for bubbling, while GestureScrollEnd is |
| 403 // always forwarded and handled according to current scroll state in the | 410 // always forwarded and handled according to current scroll state in the |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 return frame_connector_->TransformPointToCoordSpaceForView( | 630 return frame_connector_->TransformPointToCoordSpaceForView( |
| 624 point, target_view, cc::SurfaceId(frame_sink_id_, local_surface_id_), | 631 point, target_view, cc::SurfaceId(frame_sink_id_, local_surface_id_), |
| 625 transformed_point); | 632 transformed_point); |
| 626 } | 633 } |
| 627 | 634 |
| 628 bool RenderWidgetHostViewChildFrame::IsRenderWidgetHostViewChildFrame() { | 635 bool RenderWidgetHostViewChildFrame::IsRenderWidgetHostViewChildFrame() { |
| 629 return true; | 636 return true; |
| 630 } | 637 } |
| 631 | 638 |
| 632 void RenderWidgetHostViewChildFrame::WillSendScreenRects() { | 639 void RenderWidgetHostViewChildFrame::WillSendScreenRects() { |
| 633 if (frame_connector_) | 640 // TODO(kenrb): These represent post-initialization state updates that are |
| 641 // needed by the renderer. During normal OOPIF setup these are unnecessary, |
| 642 // as the parent renderer will send the information and it will be |
| 643 // immediately propagated to the OOPIF. However when an OOPIF navigates from |
| 644 // one process to another, the parent doesn't know that, and certain |
| 645 // browser-side state needs to be sent again. There is probably a less |
| 646 // spammy way to do this, but triggering on SendScreenRects() is reasonable |
| 647 // until somebody figures that out. RWHVCF::Init() is too early. |
| 648 if (frame_connector_) { |
| 634 UpdateViewportIntersection(frame_connector_->viewport_intersection()); | 649 UpdateViewportIntersection(frame_connector_->viewport_intersection()); |
| 650 SetIsInert(); |
| 651 } |
| 635 } | 652 } |
| 636 | 653 |
| 637 #if defined(OS_MACOSX) | 654 #if defined(OS_MACOSX) |
| 638 ui::AcceleratedWidgetMac* | 655 ui::AcceleratedWidgetMac* |
| 639 RenderWidgetHostViewChildFrame::GetAcceleratedWidgetMac() const { | 656 RenderWidgetHostViewChildFrame::GetAcceleratedWidgetMac() const { |
| 640 return nullptr; | 657 return nullptr; |
| 641 } | 658 } |
| 642 | 659 |
| 643 void RenderWidgetHostViewChildFrame::SetActive(bool active) { | 660 void RenderWidgetHostViewChildFrame::SetActive(bool active) { |
| 644 } | 661 } |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 auto origin = GetViewBounds().origin() - | 870 auto origin = GetViewBounds().origin() - |
| 854 frame_connector_->GetRootRenderWidgetHostView() | 871 frame_connector_->GetRootRenderWidgetHostView() |
| 855 ->GetViewBounds() | 872 ->GetViewBounds() |
| 856 .origin(); | 873 .origin(); |
| 857 return gfx::Point(origin.x(), origin.y()); | 874 return gfx::Point(origin.x(), origin.y()); |
| 858 } | 875 } |
| 859 return gfx::Point(); | 876 return gfx::Point(); |
| 860 } | 877 } |
| 861 | 878 |
| 862 } // namespace content | 879 } // namespace content |
| OLD | NEW |