| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/debug/trace_event.h" | 13 #include "base/debug/trace_event.h" |
| 14 #include "base/i18n/rtl.h" | 14 #include "base/i18n/rtl.h" |
| 15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 16 #include "base/metrics/field_trial.h" | 16 #include "base/metrics/field_trial.h" |
| 17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
| 18 #include "base/string_number_conversions.h" | 18 #include "base/string_number_conversions.h" |
| 19 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
| 20 #include "content/browser/gpu/gpu_process_host.h" | 20 #include "content/browser/gpu/gpu_process_host.h" |
| 21 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 21 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| 22 #include "content/browser/gpu/gpu_surface_tracker.h" | 22 #include "content/browser/gpu/gpu_surface_tracker.h" |
| 23 #include "content/browser/renderer_host/backing_store.h" | 23 #include "content/browser/renderer_host/backing_store.h" |
| 24 #include "content/browser/renderer_host/backing_store_manager.h" | 24 #include "content/browser/renderer_host/backing_store_manager.h" |
| 25 #include "content/browser/renderer_host/gesture_event_filter.h" |
| 25 #include "content/browser/renderer_host/render_process_host_impl.h" | 26 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 26 #include "content/browser/renderer_host/render_view_host_impl.h" | 27 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 27 #include "content/browser/renderer_host/render_widget_helper.h" | 28 #include "content/browser/renderer_host/render_widget_helper.h" |
| 28 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 29 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
| 29 #include "content/browser/renderer_host/tap_suppression_controller.h" | 30 #include "content/browser/renderer_host/tap_suppression_controller.h" |
| 30 #include "content/common/accessibility_messages.h" | 31 #include "content/common/accessibility_messages.h" |
| 31 #include "content/common/gpu/gpu_messages.h" | 32 #include "content/common/gpu/gpu_messages.h" |
| 32 #include "content/common/view_messages.h" | 33 #include "content/common/view_messages.h" |
| 33 #include "content/port/browser/render_widget_host_view_port.h" | 34 #include "content/port/browser/render_widget_host_view_port.h" |
| 34 #include "content/port/browser/smooth_scroll_gesture.h" | 35 #include "content/port/browser/smooth_scroll_gesture.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 bool ShouldCoalesceMouseWheelEvents(const WebMouseWheelEvent& last_event, | 88 bool ShouldCoalesceMouseWheelEvents(const WebMouseWheelEvent& last_event, |
| 88 const WebMouseWheelEvent& new_event) { | 89 const WebMouseWheelEvent& new_event) { |
| 89 return last_event.modifiers == new_event.modifiers && | 90 return last_event.modifiers == new_event.modifiers && |
| 90 last_event.scrollByPage == new_event.scrollByPage && | 91 last_event.scrollByPage == new_event.scrollByPage && |
| 91 last_event.hasPreciseScrollingDeltas | 92 last_event.hasPreciseScrollingDeltas |
| 92 == new_event.hasPreciseScrollingDeltas && | 93 == new_event.hasPreciseScrollingDeltas && |
| 93 last_event.phase == new_event.phase && | 94 last_event.phase == new_event.phase && |
| 94 last_event.momentumPhase == new_event.momentumPhase; | 95 last_event.momentumPhase == new_event.momentumPhase; |
| 95 } | 96 } |
| 96 | 97 |
| 97 // Returns |true| if two gesture events should be coalesced. | |
| 98 bool ShouldCoalesceGestureEvents(const WebKit::WebGestureEvent& last_event, | |
| 99 const WebKit::WebGestureEvent& new_event) { | |
| 100 return new_event.type == WebInputEvent::GestureScrollUpdate && | |
| 101 last_event.type == new_event.type && | |
| 102 last_event.modifiers == new_event.modifiers; | |
| 103 } | |
| 104 | |
| 105 } // namespace | 98 } // namespace |
| 106 | 99 |
| 107 | 100 |
| 108 // static | 101 // static |
| 109 void RenderWidgetHost::RemoveAllBackingStores() { | 102 void RenderWidgetHost::RemoveAllBackingStores() { |
| 110 BackingStoreManager::RemoveAllBackingStores(); | 103 BackingStoreManager::RemoveAllBackingStores(); |
| 111 } | 104 } |
| 112 | 105 |
| 113 // static | 106 // static |
| 114 size_t RenderWidgetHost::BackingStoreMemorySize() { | 107 size_t RenderWidgetHost::BackingStoreMemorySize() { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 130 surface_id_(0), | 123 surface_id_(0), |
| 131 is_loading_(false), | 124 is_loading_(false), |
| 132 is_hidden_(false), | 125 is_hidden_(false), |
| 133 is_fullscreen_(false), | 126 is_fullscreen_(false), |
| 134 is_accelerated_compositing_active_(false), | 127 is_accelerated_compositing_active_(false), |
| 135 repaint_ack_pending_(false), | 128 repaint_ack_pending_(false), |
| 136 resize_ack_pending_(false), | 129 resize_ack_pending_(false), |
| 137 should_auto_resize_(false), | 130 should_auto_resize_(false), |
| 138 mouse_move_pending_(false), | 131 mouse_move_pending_(false), |
| 139 mouse_wheel_pending_(false), | 132 mouse_wheel_pending_(false), |
| 140 gesture_event_pending_(false), | |
| 141 needs_repainting_on_restore_(false), | 133 needs_repainting_on_restore_(false), |
| 142 is_unresponsive_(false), | 134 is_unresponsive_(false), |
| 143 in_flight_event_count_(0), | 135 in_flight_event_count_(0), |
| 144 in_get_backing_store_(false), | 136 in_get_backing_store_(false), |
| 145 abort_get_backing_store_(false), | 137 abort_get_backing_store_(false), |
| 146 view_being_painted_(false), | 138 view_being_painted_(false), |
| 147 ignore_input_events_(false), | 139 ignore_input_events_(false), |
| 148 text_direction_updated_(false), | 140 text_direction_updated_(false), |
| 149 text_direction_(WebKit::WebTextDirectionLeftToRight), | 141 text_direction_(WebKit::WebTextDirectionLeftToRight), |
| 150 text_direction_canceled_(false), | 142 text_direction_canceled_(false), |
| 151 suppress_next_char_events_(false), | 143 suppress_next_char_events_(false), |
| 152 pending_mouse_lock_request_(false), | 144 pending_mouse_lock_request_(false), |
| 153 allow_privileged_mouse_lock_(false), | 145 allow_privileged_mouse_lock_(false), |
| 154 has_touch_handler_(false), | 146 has_touch_handler_(false), |
| 155 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), | 147 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), |
| 156 tap_suppression_controller_(new TapSuppressionController(this)), | 148 gesture_event_filter_(new GestureEventFilter(this)) { |
| 157 fling_in_progress_(false) { | |
| 158 CHECK(delegate_); | 149 CHECK(delegate_); |
| 159 if (routing_id_ == MSG_ROUTING_NONE) { | 150 if (routing_id_ == MSG_ROUTING_NONE) { |
| 160 routing_id_ = process_->GetNextRoutingID(); | 151 routing_id_ = process_->GetNextRoutingID(); |
| 161 surface_id_ = GpuSurfaceTracker::Get()->AddSurfaceForRenderer( | 152 surface_id_ = GpuSurfaceTracker::Get()->AddSurfaceForRenderer( |
| 162 process_->GetID(), | 153 process_->GetID(), |
| 163 routing_id_); | 154 routing_id_); |
| 164 } else { | 155 } else { |
| 165 // TODO(piman): This is a O(N) lookup, where we could forward the | 156 // TODO(piman): This is a O(N) lookup, where we could forward the |
| 166 // information from the RenderWidgetHelper. The problem is that doing so | 157 // information from the RenderWidgetHelper. The problem is that doing so |
| 167 // currently leaks outside of content all the way to chrome classes, and | 158 // currently leaks outside of content all the way to chrome classes, and |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 void RenderWidgetHostImpl::ViewDestroyed() { | 480 void RenderWidgetHostImpl::ViewDestroyed() { |
| 490 RejectMouseLockOrUnlockIfNecessary(); | 481 RejectMouseLockOrUnlockIfNecessary(); |
| 491 | 482 |
| 492 // TODO(evanm): tracking this may no longer be necessary; | 483 // TODO(evanm): tracking this may no longer be necessary; |
| 493 // eliminate this function if so. | 484 // eliminate this function if so. |
| 494 SetView(NULL); | 485 SetView(NULL); |
| 495 } | 486 } |
| 496 | 487 |
| 497 void RenderWidgetHostImpl::SetIsLoading(bool is_loading) { | 488 void RenderWidgetHostImpl::SetIsLoading(bool is_loading) { |
| 498 is_loading_ = is_loading; | 489 is_loading_ = is_loading; |
| 499 fling_in_progress_ = false; | 490 gesture_event_filter_->FlingHasBeenHalted(); |
| 500 if (!view_) | 491 if (!view_) |
| 501 return; | 492 return; |
| 502 view_->SetIsLoading(is_loading); | 493 view_->SetIsLoading(is_loading); |
| 503 } | 494 } |
| 504 | 495 |
| 505 void RenderWidgetHostImpl::CopyFromBackingStore( | 496 void RenderWidgetHostImpl::CopyFromBackingStore( |
| 506 const gfx::Rect& src_subrect, | 497 const gfx::Rect& src_subrect, |
| 507 const gfx::Size& accelerated_dst_size, | 498 const gfx::Size& accelerated_dst_size, |
| 508 const base::Callback<void(bool)>& callback, | 499 const base::Callback<void(bool)>& callback, |
| 509 skia::PlatformCanvas* output) { | 500 skia::PlatformCanvas* output) { |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 int x = next_mouse_move_->movementX; | 856 int x = next_mouse_move_->movementX; |
| 866 int y = next_mouse_move_->movementY; | 857 int y = next_mouse_move_->movementY; |
| 867 *next_mouse_move_ = mouse_event; | 858 *next_mouse_move_ = mouse_event; |
| 868 next_mouse_move_->movementX += x; | 859 next_mouse_move_->movementX += x; |
| 869 next_mouse_move_->movementY += y; | 860 next_mouse_move_->movementY += y; |
| 870 } | 861 } |
| 871 return; | 862 return; |
| 872 } | 863 } |
| 873 mouse_move_pending_ = true; | 864 mouse_move_pending_ = true; |
| 874 } else if (mouse_event.type == WebInputEvent::MouseDown) { | 865 } else if (mouse_event.type == WebInputEvent::MouseDown) { |
| 875 if (tap_suppression_controller_->ShouldDeferMouseDown(mouse_event)) | 866 if (gesture_event_filter_->GetTapSuppressionController()-> |
| 867 ShouldDeferMouseDown(mouse_event)) |
| 876 return; | 868 return; |
| 877 OnUserGesture(); | 869 OnUserGesture(); |
| 878 } else if (mouse_event.type == WebInputEvent::MouseUp) { | 870 } else if (mouse_event.type == WebInputEvent::MouseUp) { |
| 879 if (tap_suppression_controller_->ShouldSuppressMouseUp()) | 871 if (gesture_event_filter_->GetTapSuppressionController()-> |
| 872 ShouldSuppressMouseUp()) |
| 880 return; | 873 return; |
| 881 } | 874 } |
| 882 | 875 |
| 883 ForwardInputEvent(mouse_event, sizeof(WebMouseEvent), false); | 876 ForwardInputEvent(mouse_event, sizeof(WebMouseEvent), false); |
| 884 } | 877 } |
| 885 | 878 |
| 886 void RenderWidgetHostImpl::OnPointerEventActivate() { | 879 void RenderWidgetHostImpl::OnPointerEventActivate() { |
| 887 } | 880 } |
| 888 | 881 |
| 889 void RenderWidgetHostImpl::ForwardWheelEvent( | 882 void RenderWidgetHostImpl::ForwardWheelEvent( |
| (...skipping 29 matching lines...) Expand all Loading... |
| 919 | 912 |
| 920 HISTOGRAM_COUNTS_100("MPArch.RWH_WheelQueueSize", | 913 HISTOGRAM_COUNTS_100("MPArch.RWH_WheelQueueSize", |
| 921 coalesced_mouse_wheel_events_.size()); | 914 coalesced_mouse_wheel_events_.size()); |
| 922 | 915 |
| 923 ForwardInputEvent(wheel_event, sizeof(WebMouseWheelEvent), false); | 916 ForwardInputEvent(wheel_event, sizeof(WebMouseWheelEvent), false); |
| 924 } | 917 } |
| 925 | 918 |
| 926 void RenderWidgetHostImpl::ForwardGestureEvent( | 919 void RenderWidgetHostImpl::ForwardGestureEvent( |
| 927 const WebKit::WebGestureEvent& gesture_event) { | 920 const WebKit::WebGestureEvent& gesture_event) { |
| 928 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardGestureEvent"); | 921 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardGestureEvent"); |
| 929 if (ignore_input_events_ || process_->IgnoreInputEvents()) | 922 if (ignore_input_events_ || process_->IgnoreInputEvents() || |
| 923 !gesture_event_filter_->ShouldForward(gesture_event)) |
| 930 return; | 924 return; |
| 931 | 925 |
| 932 if (gesture_event.type == WebInputEvent::GestureFlingCancel) { | |
| 933 if (ShouldDiscardFlingCancelEvent(gesture_event)) | |
| 934 return; | |
| 935 fling_in_progress_ = false; | |
| 936 } | |
| 937 | |
| 938 if (gesture_event_pending_) { | |
| 939 if (coalesced_gesture_events_.empty() || | |
| 940 !ShouldCoalesceGestureEvents(coalesced_gesture_events_.back(), | |
| 941 gesture_event)) { | |
| 942 coalesced_gesture_events_.push_back(gesture_event); | |
| 943 } else { | |
| 944 WebGestureEvent* last_gesture_event = | |
| 945 &coalesced_gesture_events_.back(); | |
| 946 last_gesture_event->deltaX += gesture_event.deltaX; | |
| 947 last_gesture_event->deltaY += gesture_event.deltaY; | |
| 948 DCHECK_GE(gesture_event.timeStampSeconds, | |
| 949 last_gesture_event->timeStampSeconds); | |
| 950 last_gesture_event->timeStampSeconds = gesture_event.timeStampSeconds; | |
| 951 } | |
| 952 return; | |
| 953 } | |
| 954 gesture_event_pending_ = true; | |
| 955 | |
| 956 if (gesture_event.type == WebInputEvent::GestureFlingCancel) { | |
| 957 tap_suppression_controller_->GestureFlingCancel( | |
| 958 gesture_event.timeStampSeconds); | |
| 959 } else if (gesture_event.type == WebInputEvent::GestureFlingStart) { | |
| 960 fling_in_progress_ = true; | |
| 961 } | |
| 962 | |
| 963 ForwardInputEvent(gesture_event, sizeof(WebGestureEvent), false); | 926 ForwardInputEvent(gesture_event, sizeof(WebGestureEvent), false); |
| 964 } | 927 } |
| 965 | 928 |
| 966 void RenderWidgetHostImpl::ForwardKeyboardEvent( | 929 void RenderWidgetHostImpl::ForwardKeyboardEvent( |
| 967 const NativeWebKeyboardEvent& key_event) { | 930 const NativeWebKeyboardEvent& key_event) { |
| 968 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardKeyboardEvent"); | 931 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardKeyboardEvent"); |
| 969 if (ignore_input_events_ || process_->IgnoreInputEvents()) | 932 if (ignore_input_events_ || process_->IgnoreInputEvents()) |
| 970 return; | 933 return; |
| 971 | 934 |
| 972 if (key_event.type == WebKeyboardEvent::Char && | 935 if (key_event.type == WebKeyboardEvent::Char && |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 // Don't add this key to the queue if we have no way to send the message... | 978 // Don't add this key to the queue if we have no way to send the message... |
| 1016 if (!process_->HasConnection()) | 979 if (!process_->HasConnection()) |
| 1017 return; | 980 return; |
| 1018 | 981 |
| 1019 // Put all WebKeyboardEvent objects in a queue since we can't trust the | 982 // Put all WebKeyboardEvent objects in a queue since we can't trust the |
| 1020 // renderer and we need to give something to the HandleKeyboardEvent | 983 // renderer and we need to give something to the HandleKeyboardEvent |
| 1021 // handler. | 984 // handler. |
| 1022 key_queue_.push_back(key_event); | 985 key_queue_.push_back(key_event); |
| 1023 HISTOGRAM_COUNTS_100("Renderer.KeyboardQueueSize", key_queue_.size()); | 986 HISTOGRAM_COUNTS_100("Renderer.KeyboardQueueSize", key_queue_.size()); |
| 1024 | 987 |
| 1025 fling_in_progress_ = false; // Key events always stop flings. | 988 gesture_event_filter_->FlingHasBeenHalted(); |
| 1026 | 989 |
| 1027 // Only forward the non-native portions of our event. | 990 // Only forward the non-native portions of our event. |
| 1028 ForwardInputEvent(key_event, sizeof(WebKeyboardEvent), | 991 ForwardInputEvent(key_event, sizeof(WebKeyboardEvent), |
| 1029 is_keyboard_shortcut); | 992 is_keyboard_shortcut); |
| 1030 } | 993 } |
| 1031 } | 994 } |
| 1032 | 995 |
| 1033 void RenderWidgetHostImpl::ForwardInputEvent(const WebInputEvent& input_event, | 996 void RenderWidgetHostImpl::ForwardInputEvent(const WebInputEvent& input_event, |
| 1034 int event_size, | 997 int event_size, |
| 1035 bool is_keyboard_shortcut) { | 998 bool is_keyboard_shortcut) { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 renderer_initialized_ = false; | 1077 renderer_initialized_ = false; |
| 1115 | 1078 |
| 1116 // Must reset these to ensure that mouse move/wheel events work with a new | 1079 // Must reset these to ensure that mouse move/wheel events work with a new |
| 1117 // renderer. | 1080 // renderer. |
| 1118 mouse_move_pending_ = false; | 1081 mouse_move_pending_ = false; |
| 1119 next_mouse_move_.reset(); | 1082 next_mouse_move_.reset(); |
| 1120 mouse_wheel_pending_ = false; | 1083 mouse_wheel_pending_ = false; |
| 1121 coalesced_mouse_wheel_events_.clear(); | 1084 coalesced_mouse_wheel_events_.clear(); |
| 1122 | 1085 |
| 1123 // Must reset these to ensure that gesture events work with a new renderer. | 1086 // Must reset these to ensure that gesture events work with a new renderer. |
| 1124 coalesced_gesture_events_.clear(); | 1087 gesture_event_filter_->Reset(); |
| 1125 gesture_event_pending_ = false; | |
| 1126 | 1088 |
| 1127 // Must reset these to ensure that keyboard events work with a new renderer. | 1089 // Must reset these to ensure that keyboard events work with a new renderer. |
| 1128 key_queue_.clear(); | 1090 key_queue_.clear(); |
| 1129 suppress_next_char_events_ = false; | 1091 suppress_next_char_events_ = false; |
| 1130 | 1092 |
| 1131 // Reset some fields in preparation for recovering from a crash. | 1093 // Reset some fields in preparation for recovering from a crash. |
| 1132 resize_ack_pending_ = false; | 1094 resize_ack_pending_ = false; |
| 1133 repaint_ack_pending_ = false; | 1095 repaint_ack_pending_ = false; |
| 1134 | 1096 |
| 1135 in_flight_size_.SetSize(0, 0); | 1097 in_flight_size_.SetSize(0, 0); |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1617 base::TimeDelta::FromMilliseconds(kSyntheticScrollMessageIntervalMs)); | 1579 base::TimeDelta::FromMilliseconds(kSyntheticScrollMessageIntervalMs)); |
| 1618 | 1580 |
| 1619 | 1581 |
| 1620 bool active = active_smooth_scroll_gesture_->ForwardInputEvents(now, this); | 1582 bool active = active_smooth_scroll_gesture_->ForwardInputEvents(now, this); |
| 1621 if (!active) { | 1583 if (!active) { |
| 1622 active_smooth_scroll_gesture_.reset(); | 1584 active_smooth_scroll_gesture_.reset(); |
| 1623 // TODO(nduca): send "smooth scroll done" event to RenderWidget. | 1585 // TODO(nduca): send "smooth scroll done" event to RenderWidget. |
| 1624 } | 1586 } |
| 1625 } | 1587 } |
| 1626 | 1588 |
| 1627 bool RenderWidgetHostImpl::ShouldDiscardFlingCancelEvent( | |
| 1628 const WebKit::WebGestureEvent& gesture_event) { | |
| 1629 DCHECK(gesture_event.type == WebInputEvent::GestureFlingCancel); | |
| 1630 if (coalesced_gesture_events_.empty() && fling_in_progress_) | |
| 1631 return false; | |
| 1632 GestureEventQueue::reverse_iterator it = | |
| 1633 coalesced_gesture_events_.rbegin(); | |
| 1634 while (it != coalesced_gesture_events_.rend()) { | |
| 1635 if (it->type == WebInputEvent::GestureFlingStart) | |
| 1636 return false; | |
| 1637 if (it->type == WebInputEvent::GestureFlingCancel) | |
| 1638 return true; | |
| 1639 it++; | |
| 1640 } | |
| 1641 return true; | |
| 1642 } | |
| 1643 | |
| 1644 void RenderWidgetHostImpl::ProcessWheelAck(bool processed) { | 1589 void RenderWidgetHostImpl::ProcessWheelAck(bool processed) { |
| 1645 mouse_wheel_pending_ = false; | 1590 mouse_wheel_pending_ = false; |
| 1646 | 1591 |
| 1647 // Now send the next (coalesced) mouse wheel event. | 1592 // Now send the next (coalesced) mouse wheel event. |
| 1648 if (!coalesced_mouse_wheel_events_.empty()) { | 1593 if (!coalesced_mouse_wheel_events_.empty()) { |
| 1649 WebMouseWheelEvent next_wheel_event = | 1594 WebMouseWheelEvent next_wheel_event = |
| 1650 coalesced_mouse_wheel_events_.front(); | 1595 coalesced_mouse_wheel_events_.front(); |
| 1651 coalesced_mouse_wheel_events_.pop_front(); | 1596 coalesced_mouse_wheel_events_.pop_front(); |
| 1652 ForwardWheelEvent(next_wheel_event); | 1597 ForwardWheelEvent(next_wheel_event); |
| 1653 } | 1598 } |
| 1654 | 1599 |
| 1655 if (!processed && !is_hidden_ && view_) | 1600 if (!processed && !is_hidden_ && view_) |
| 1656 view_->UnhandledWheelEvent(current_wheel_event_); | 1601 view_->UnhandledWheelEvent(current_wheel_event_); |
| 1657 } | 1602 } |
| 1658 | 1603 |
| 1659 void RenderWidgetHostImpl::ProcessGestureAck(bool processed, int type) { | 1604 void RenderWidgetHostImpl::ProcessGestureAck(bool processed, int type) { |
| 1660 if (type == WebInputEvent::GestureFlingCancel) | 1605 gesture_event_filter_->ProcessGestureAck(processed, type); |
| 1661 tap_suppression_controller_->GestureFlingCancelAck(processed); | |
| 1662 | |
| 1663 gesture_event_pending_ = false; | |
| 1664 | |
| 1665 // Now send the next (coalesced) gesture event. | |
| 1666 if (!coalesced_gesture_events_.empty()) { | |
| 1667 WebGestureEvent next_gesture_event = | |
| 1668 coalesced_gesture_events_.front(); | |
| 1669 coalesced_gesture_events_.pop_front(); | |
| 1670 ForwardGestureEvent(next_gesture_event); | |
| 1671 } | |
| 1672 } | 1606 } |
| 1673 | 1607 |
| 1674 void RenderWidgetHostImpl::ProcessTouchAck( | 1608 void RenderWidgetHostImpl::ProcessTouchAck( |
| 1675 WebInputEvent::Type type, bool processed) { | 1609 WebInputEvent::Type type, bool processed) { |
| 1676 if (view_) | 1610 if (view_) |
| 1677 view_->ProcessTouchAck(type, processed); | 1611 view_->ProcessTouchAck(type, processed); |
| 1678 } | 1612 } |
| 1679 | 1613 |
| 1680 void RenderWidgetHostImpl::OnMsgFocus() { | 1614 void RenderWidgetHostImpl::OnMsgFocus() { |
| 1681 // Only RenderViewHost can deal with that message. | 1615 // Only RenderViewHost can deal with that message. |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2051 // indicate that no callback is in progress (i.e. without this line | 1985 // indicate that no callback is in progress (i.e. without this line |
| 2052 // DelayedAutoResized will not get called again). | 1986 // DelayedAutoResized will not get called again). |
| 2053 new_auto_size_.SetSize(0, 0); | 1987 new_auto_size_.SetSize(0, 0); |
| 2054 if (!should_auto_resize_) | 1988 if (!should_auto_resize_) |
| 2055 return; | 1989 return; |
| 2056 | 1990 |
| 2057 OnRenderAutoResized(new_size); | 1991 OnRenderAutoResized(new_size); |
| 2058 } | 1992 } |
| 2059 | 1993 |
| 2060 } // namespace content | 1994 } // namespace content |
| OLD | NEW |