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

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

Issue 11411059: overscroll-aura: Discard synthetic mouse-move events during a trackpad overscroll. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 4a04d3ab9753db322271e04b48f9ed5eb8394290..1adb873741bbce0414bee46f343363277940258c 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -13,6 +13,7 @@
#include "base/string_number_conversions.h"
#include "content/browser/renderer_host/backing_store_aura.h"
#include "content/browser/renderer_host/dip_util.h"
+#include "content/browser/renderer_host/overscroll_controller.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/ui_events_helper.h"
@@ -1569,6 +1570,15 @@ ui::EventResult RenderWidgetHostViewAura::OnMouseEvent(ui::MouseEvent* event) {
return ui::ER_UNHANDLED;
}
+ // If the overscroll controller is active, then drop all synthetic move events
+ // on the floor.
sky 2012/11/19 16:25:01 Document why you do this.
sadrul 2012/11/19 16:34:35 Done.
+ if (host_->overscroll_controller() &&
+ host_->overscroll_controller()->overscroll_mode() != OVERSCROLL_NONE &&
+ event->type() == ui::ET_MOUSE_MOVED &&
+ (event->flags() & ui::EF_IS_SYNTHESIZED)) {
+ return ui::ER_CONSUMED;
+ }
+
if (event->type() == ui::ET_MOUSEWHEEL) {
WebKit::WebMouseWheelEvent mouse_wheel_event =
MakeWebMouseWheelEvent(static_cast<ui::MouseWheelEvent*>(event));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698