Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1141)

Unified Diff: content/browser/renderer_host/input/input_router_impl.cc

Issue 217253002: [Android] Short-circuit touch forwarding when no touch handlers exist (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/input/input_router_impl.cc
diff --git a/content/browser/renderer_host/input/input_router_impl.cc b/content/browser/renderer_host/input/input_router_impl.cc
index 105051105bb1a7f5bff2551a063bec41ba313a65..b7ee95d025e003cf7763556563229d889df5c3c2 100644
--- a/content/browser/renderer_host/input/input_router_impl.cc
+++ b/content/browser/renderer_host/input/input_router_impl.cc
@@ -311,8 +311,9 @@ const NativeWebKeyboardEvent* InputRouterImpl::GetLastKeyboardEvent() const {
}
bool InputRouterImpl::ShouldForwardTouchEvent() const {
- // Always send a touch event if the renderer has a touch-event handler.
- return touch_event_queue_->has_handlers();
+ // Always send a touch event if the renderer has a touch-event handler or
+ // there are pending touch events.
+ return touch_event_queue_->has_handlers() || !touch_event_queue_->empty();
}
void InputRouterImpl::OnViewUpdated(int view_flags) {

Powered by Google App Engine
This is Rietveld 408576698