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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 // and will also expect a notification when the fling ends. Since | 721 // and will also expect a notification when the fling ends. Since |
722 // CrOS just uses the GestureFlingStart with zero-velocity as a means | 722 // CrOS just uses the GestureFlingStart with zero-velocity as a means |
723 // of indicating that touchpad scroll has ended, we don't actually want | 723 // of indicating that touchpad scroll has ended, we don't actually want |
724 // a fling animation. | 724 // a fling animation. |
725 // Note: this event handling is modeled on similar code in | 725 // Note: this event handling is modeled on similar code in |
726 // TenderWidgetHostViewAura::FilterInputEvent(). | 726 // TenderWidgetHostViewAura::FilterInputEvent(). |
727 return INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; | 727 return INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; |
728 } | 728 } |
729 } | 729 } |
730 | 730 |
| 731 // TODO(mcnee): Allow the root RWHV to consume the child's |
| 732 // GestureScrollUpdates. This is needed to prevent the child from consuming |
| 733 // them after the root has started an overscroll. |
| 734 // See crbug.com/713368 |
| 735 |
731 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; | 736 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
732 } | 737 } |
733 | 738 |
| 739 InputEventAckState RenderWidgetHostViewChildFrame::FilterChildGestureEvent( |
| 740 const blink::WebGestureEvent& gesture_event) { |
| 741 // We may be the owner of a RenderWidgetHostViewGuest, |
| 742 // so we talk to the root RWHV on its behalf. |
| 743 // TODO(mcnee): Remove once MimeHandlerViewGuest is based on OOPIF. |
| 744 // See crbug.com/659750 |
| 745 if (frame_connector_) |
| 746 return frame_connector_->GetRootRenderWidgetHostView() |
| 747 ->FilterChildGestureEvent(gesture_event); |
| 748 return INPUT_EVENT_ACK_STATE_NOT_CONSUMED; |
| 749 } |
| 750 |
734 void RenderWidgetHostViewChildFrame::OnSetNeedsFlushInput() { | 751 void RenderWidgetHostViewChildFrame::OnSetNeedsFlushInput() { |
735 NOTIMPLEMENTED(); | 752 NOTIMPLEMENTED(); |
736 } | 753 } |
737 | 754 |
738 BrowserAccessibilityManager* | 755 BrowserAccessibilityManager* |
739 RenderWidgetHostViewChildFrame::CreateBrowserAccessibilityManager( | 756 RenderWidgetHostViewChildFrame::CreateBrowserAccessibilityManager( |
740 BrowserAccessibilityDelegate* delegate, bool for_root_frame) { | 757 BrowserAccessibilityDelegate* delegate, bool for_root_frame) { |
741 return BrowserAccessibilityManager::Create( | 758 return BrowserAccessibilityManager::Create( |
742 BrowserAccessibilityManager::GetEmptyDocument(), delegate); | 759 BrowserAccessibilityManager::GetEmptyDocument(), delegate); |
743 } | 760 } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 auto origin = GetViewBounds().origin() - | 834 auto origin = GetViewBounds().origin() - |
818 frame_connector_->GetRootRenderWidgetHostView() | 835 frame_connector_->GetRootRenderWidgetHostView() |
819 ->GetViewBounds() | 836 ->GetViewBounds() |
820 .origin(); | 837 .origin(); |
821 return gfx::Point(origin.x(), origin.y()); | 838 return gfx::Point(origin.x(), origin.y()); |
822 } | 839 } |
823 return gfx::Point(); | 840 return gfx::Point(); |
824 } | 841 } |
825 | 842 |
826 } // namespace content | 843 } // namespace content |
OLD | NEW |