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

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

Issue 2815823003: Notify OverscrollController of gesture events in plugins. (Closed)
Patch Set: Address comments. Created 3 years, 7 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/overscroll_controller.cc
diff --git a/content/browser/renderer_host/overscroll_controller.cc b/content/browser/renderer_host/overscroll_controller.cc
index ef9fcafce86f38870e825feb8b61a89d939074e0..7f32ae0fcf1125a0eff83282e1a2a443dd73578c 100644
--- a/content/browser/renderer_host/overscroll_controller.cc
+++ b/content/browser/renderer_host/overscroll_controller.cc
@@ -51,6 +51,16 @@ bool OverscrollController::ShouldProcessEvent(
case blink::WebInputEvent::kGestureScrollEnd: {
const blink::WebGestureEvent& gesture =
static_cast<const blink::WebGestureEvent&>(event);
+
+ // GestureScrollBegin and GestureScrollEnd events are created to wrap
+ // individual resent GestureScrollUpdates from a plugin. Hence these
+ // should not be used to indicate the beginning/end of the overscroll.
+ // TODO(mcnee): When we remove BrowserPlugin, delete this code.
+ // See crbug.com/533069
+ if (gesture.resending_plugin_id != -1 &&
+ event.GetType() != blink::WebInputEvent::kGestureScrollUpdate)
+ return false;
+
blink::WebGestureEvent::ScrollUnits scrollUnits;
switch (event.GetType()) {
case blink::WebInputEvent::kGestureScrollBegin:
« no previous file with comments | « content/browser/renderer_host/overscroll_controller.h ('k') | content/browser/renderer_host/render_widget_host_view_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698