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

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

Issue 7618036: mac: Only let two-finger-scrolling trigger history if web doesn't swallow gesture (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: TestRenderViewHost Created 9 years, 4 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.cc
diff --git a/content/browser/renderer_host/render_widget_host.cc b/content/browser/renderer_host/render_widget_host.cc
index 820ab6782628796d8d423ab62d899f070a88c00b..811392ad1774caf4c1ea49a594f54482055dc1e3 100644
--- a/content/browser/renderer_host/render_widget_host.cc
+++ b/content/browser/renderer_host/render_widget_host.cc
@@ -554,6 +554,7 @@ void RenderWidgetHost::ForwardWheelEvent(
return;
}
mouse_wheel_pending_ = true;
+ current_wheel_event_ = wheel_event;
HISTOGRAM_COUNTS_100("MPArch.RWH_WheelQueueSize",
coalesced_mouse_wheel_events_.size());
@@ -1013,8 +1014,6 @@ void RenderWidgetHost::OnMsgInputEventAck(const IPC::Message& message) {
DCHECK(next_mouse_move_->type == WebInputEvent::MouseMove);
ForwardMouseEvent(*next_mouse_move_);
}
- } else if (type == WebInputEvent::MouseWheel) {
- ProcessWheelAck();
} else if (WebInputEvent::isKeyboardEventType(type)) {
bool processed = false;
if (!message.ReadBool(&iter, &processed)) {
@@ -1023,6 +1022,14 @@ void RenderWidgetHost::OnMsgInputEventAck(const IPC::Message& message) {
}
ProcessKeyboardEventAck(type, processed);
+ } else if (type == WebInputEvent::MouseWheel) {
+ bool processed = false;
+ if (!message.ReadBool(&iter, &processed)) {
+ UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_RWH4"));
+ process()->ReceivedBadMessage();
+ }
+
+ ProcessWheelAck(processed);
} else if (type == WebInputEvent::TouchMove) {
touch_move_pending_ = false;
if (touch_event_is_queued_) {
@@ -1037,7 +1044,7 @@ void RenderWidgetHost::OnMsgInputEventAck(const IPC::Message& message) {
Details<int>(&type));
}
-void RenderWidgetHost::ProcessWheelAck() {
+void RenderWidgetHost::ProcessWheelAck(bool processed) {
mouse_wheel_pending_ = false;
// Now send the next (coalesced) mouse wheel event.
@@ -1047,6 +1054,9 @@ void RenderWidgetHost::ProcessWheelAck() {
coalesced_mouse_wheel_events_.pop_front();
ForwardWheelEvent(next_wheel_event);
}
+
+ if (!processed && !is_hidden_ && view_)
+ view_->UnhandledWheelEvent(current_wheel_event_);
}
void RenderWidgetHost::OnMsgFocus() {
« no previous file with comments | « content/browser/renderer_host/render_widget_host.h ('k') | content/browser/renderer_host/render_widget_host_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698