summaryrefslogtreecommitdiffstats
path: root/content/browser/renderer_host/render_widget_host.cc
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-26 20:38:42 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-26 20:38:42 +0000
commit4aeda5795fa3d1a3b3e5f7ed71c2acbc41d94a6d (patch)
tree45221c6258e7a1f8fe407645373f9a18b0e811f7 /content/browser/renderer_host/render_widget_host.cc
parentd33f0067c151a55b38ebe687727ed2d3a34affee (diff)
downloadchromium_src-4aeda5795fa3d1a3b3e5f7ed71c2acbc41d94a6d.zip
chromium_src-4aeda5795fa3d1a3b3e5f7ed71c2acbc41d94a6d.tar.gz
chromium_src-4aeda5795fa3d1a3b3e5f7ed71c2acbc41d94a6d.tar.bz2
aura: Add event queues in the GestureRecognizer.
Event-queues allow the GestureRecognizer to maintain multiple states for different gestures. Especially, this makes it possible to correctly process queued up (asynchronous) touch-events at the same time it processes synchronous touch-events. Throttling/filtering touch-events that go to the renderer is now removed. This may be added back at a later time. BUG=110230 TEST=none (will be added in a future CL: http://codereview.chromium.org/9129012/) Review URL: https://chromiumcodereview.appspot.com/9150046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119278 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/render_widget_host.cc')
-rw-r--r--content/browser/renderer_host/render_widget_host.cc27
1 files changed, 7 insertions, 20 deletions
diff --git a/content/browser/renderer_host/render_widget_host.cc b/content/browser/renderer_host/render_widget_host.cc
index d8aac2d..403330a 100644
--- a/content/browser/renderer_host/render_widget_host.cc
+++ b/content/browser/renderer_host/render_widget_host.cc
@@ -91,8 +91,6 @@ RenderWidgetHost::RenderWidgetHost(content::RenderProcessHost* process,
should_auto_resize_(false),
mouse_move_pending_(false),
mouse_wheel_pending_(false),
- touch_move_pending_(false),
- touch_event_is_queued_(false),
needs_repainting_on_restore_(false),
is_unresponsive_(false),
in_flight_event_count_(0),
@@ -732,17 +730,7 @@ void RenderWidgetHost::ForwardTouchEvent(
if (ignore_input_events_ || process_->IgnoreInputEvents())
return;
- if (touch_event.type == WebInputEvent::TouchMove &&
- touch_move_pending_) {
- touch_event_is_queued_ = true;
- queued_touch_event_ = touch_event;
- return;
- }
-
- if (touch_event.type == WebInputEvent::TouchMove)
- touch_move_pending_ = true;
- else
- touch_move_pending_ = false;
+ // TODO(sad): Do touch-event coalescing when appropriate.
ForwardInputEvent(touch_event, sizeof(WebKit::WebTouchEvent), false);
}
@@ -758,8 +746,6 @@ void RenderWidgetHost::RendererExited(base::TerminationStatus status,
next_mouse_move_.reset();
mouse_wheel_pending_ = false;
coalesced_mouse_wheel_events_.clear();
- touch_move_pending_ = false;
- touch_event_is_queued_ = false;
// Must reset these to ensure that keyboard events work with a new renderer.
key_queue_.clear();
@@ -1176,11 +1162,7 @@ void RenderWidgetHost::OnMsgInputEventAck(WebInputEvent::Type event_type,
} else if (type == WebInputEvent::MouseWheel) {
ProcessWheelAck(processed);
} else if (type == WebInputEvent::TouchMove) {
- touch_move_pending_ = false;
- if (touch_event_is_queued_) {
- touch_event_is_queued_ = false;
- ForwardTouchEvent(queued_touch_event_);
- }
+ ProcessTouchAck(processed);
}
// This is used only for testing.
content::NotificationService::current()->Notify(
@@ -1204,6 +1186,11 @@ void RenderWidgetHost::ProcessWheelAck(bool processed) {
view_->UnhandledWheelEvent(current_wheel_event_);
}
+void RenderWidgetHost::ProcessTouchAck(bool processed) {
+ if (view_)
+ view_->ProcessTouchAck(processed);
+}
+
void RenderWidgetHost::OnMsgFocus() {
// Only RenderViewHost can deal with that message.
content::RecordAction(UserMetricsAction("BadMessageTerminate_RWH4"));