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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 11188012: gesture recognizer: Remove the touch-event queue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 8 years, 2 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/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index a421f0924025c3f2661ac50d32655fca9e672856..4fcdff0f41609b004a69f807ba995b3d4e5a7036 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -1137,6 +1137,8 @@ void RenderWidgetHostImpl::RendererExited(base::TerminationStatus status,
select_range_pending_ = false;
next_selection_range_.reset();
+ touch_event_queue_->Reset();
+
// Must reset these to ensure that gesture events work with a new renderer.
gesture_event_filter_->Reset();
@@ -1756,7 +1758,11 @@ void RenderWidgetHostImpl::OnMsgBlur() {
}
void RenderWidgetHostImpl::OnMsgHasTouchEventHandlers(bool has_handlers) {
+ if (has_touch_handler_ == has_handlers)
+ return;
has_touch_handler_ = has_handlers;
+ if (!has_touch_handler_)
+ touch_event_queue_->FlushQueue();
}
void RenderWidgetHostImpl::OnMsgSetCursor(const WebCursor& cursor) {
@@ -1950,6 +1956,14 @@ const gfx::Point& RenderWidgetHostImpl::GetLastScrollOffset() const {
return last_scroll_offset_;
}
+bool RenderWidgetHostImpl::ShouldForwardTouchEvent() const {
+ // Always send a touch event if the renderer has a touch-event handler. It is
+ // possible that a renderer stops listening to touch-events while there are
+ // still events in the touch-queue. In such cases, the new events should still
+ // get into the queue.
+ return has_touch_handler_ || !touch_event_queue_->empty();
+}
+
void RenderWidgetHostImpl::StartUserGesture() {
OnUserGesture();
}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/browser/renderer_host/render_widget_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698