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

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

Issue 52263006: Put vertical overscroll behind kScrollEndEffect flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed failures in content_unittest Created 7 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 | content/browser/renderer_host/render_widget_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 069c4f18669b0f604fcacf0a4fb7140ef13b8c5f..052eedbbc50dd88364afc0199a57ce47c5d8f621 100644
--- a/content/browser/renderer_host/overscroll_controller.cc
+++ b/content/browser/renderer_host/overscroll_controller.cc
@@ -4,12 +4,23 @@
#include "content/browser/renderer_host/overscroll_controller.h"
+#include "base/command_line.h"
#include "base/logging.h"
#include "content/browser/renderer_host/overscroll_controller_delegate.h"
#include "content/public/browser/overscroll_configuration.h"
+#include "content/public/common/content_switches.h"
using WebKit::WebInputEvent;
+namespace {
+
+bool IsScrollEndEffectEnabled() {
+ return CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kScrollEndEffect) == "1";
+}
+
+} // namespace
+
namespace content {
OverscrollController::OverscrollController()
@@ -302,6 +313,12 @@ void OverscrollController::ProcessOverscroll(float delta_x,
fabs(overscroll_delta_y_) > fabs(overscroll_delta_x_) * kMinRatio)
new_mode = overscroll_delta_y_ > 0.f ? OVERSCROLL_SOUTH : OVERSCROLL_NORTH;
+ // The vertical oversrcoll currently does not have any UX effects other then
+ // for the scroll end effect, so testing if it is enabled.
+ if ((new_mode == OVERSCROLL_SOUTH || new_mode == OVERSCROLL_NORTH) &&
+ !IsScrollEndEffectEnabled())
+ new_mode = OVERSCROLL_NONE;
+
if (overscroll_mode_ == OVERSCROLL_NONE)
SetOverscrollMode(new_mode);
else if (new_mode != overscroll_mode_)
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698