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

Unified Diff: public/web/WebInputEvent.h

Issue 197213011: Selectively disable rubber banding on mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove all changes to ScrollElasticityController.{h,mm} Created 6 years, 9 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
« no previous file with comments | « Source/web/WebInputEventFactoryMac.mm ('k') | public/web/mac/WebInputEventFactory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/web/WebInputEvent.h
diff --git a/public/web/WebInputEvent.h b/public/web/WebInputEvent.h
index 819c62e1928b36c0c834fab1f5666d723e346cdd..cfa6b34756eddf2cede56b600f4b73dc6823da59 100644
--- a/public/web/WebInputEvent.h
+++ b/public/web/WebInputEvent.h
@@ -361,6 +361,24 @@ public:
Phase phase;
Phase momentumPhase;
+ // See comment at the top of the file for why an int is used here.
+ // Rubberbanding is an OSX visual effect. When a user scrolls the content
+ // area with a track pad, and the content area is already at its limit in
+ // the direction being scrolled, the entire content area is allowed to
+ // scroll slightly off screen, revealing a grey background. When the user
+ // lets go, the content area snaps back into place. Blink is responsible
+ // for this rubberbanding effect, but the embedder may wish to disable
+ // rubber banding in the left or right direction, if the scroll should have
+ // an alternate effect. The common case is that a scroll in the left or
+ // right directions causes a back or forwards navigation, respectively.
+ //
+ // These flags prevent rubber banding from starting in a given direction,
+ // but have no effect on an ongoing rubber banding. A rubber banding that
+ // started in the vertical direction is allowed to continue in the right
+ // direction, even if canRubberbandRight is 0.
+ int canRubberbandLeft;
+ int canRubberbandRight;
+
WebMouseWheelEvent(unsigned sizeParam = sizeof(WebMouseWheelEvent))
: WebMouseEvent(sizeParam)
, deltaX(0.0f)
@@ -373,6 +391,8 @@ public:
, hasPreciseScrollingDeltas(false)
, phase(PhaseNone)
, momentumPhase(PhaseNone)
+ , canRubberbandLeft(true)
+ , canRubberbandRight(true)
{
}
};
« no previous file with comments | « Source/web/WebInputEventFactoryMac.mm ('k') | public/web/mac/WebInputEventFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698