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

Unified Diff: ash/wm/workspace/workspace_cycler.cc

Issue 12212040: Make the workspace cycler animation parameters editable via chrome://gesture (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes per sadrul Created 7 years, 10 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: ash/wm/workspace/workspace_cycler.cc
diff --git a/ash/wm/workspace/workspace_cycler.cc b/ash/wm/workspace/workspace_cycler.cc
index b4b8b254b3627d0f1b7368248343c5361761f857..7f5f21959ba7b558b11e3d9e01551ce967f24664 100644
--- a/ash/wm/workspace/workspace_cycler.cc
+++ b/ash/wm/workspace/workspace_cycler.cc
@@ -7,18 +7,18 @@
#include <cmath>
#include "ash/shell.h"
+#include "ash/wm/workspace/workspace_cycler_configuration.h"
#include "ash/wm/workspace/workspace_manager.h"
#include "ui/base/events/event.h"
#include "ui/base/events/event_utils.h"
+typedef ash::WorkspaceCyclerConfiguration Config;
+
namespace ash {
namespace internal {
namespace {
-// The required vertical distance to initiate workspace cycling.
-const float kDistanceToInitiateWorkspaceCycling = 10.0f;
-
// Returns true if cycling is allowed.
bool IsCyclingAllowed() {
// Cycling is disabled if the screen is locked or a modal dialog is open.
@@ -136,7 +136,10 @@ void WorkspaceCycler::OnScrollEvent(ui::ScrollEvent* event) {
}
if (state_ == NOT_CYCLING_TRACKING_SCROLL) {
- if (fabs(scroll_x_) > kDistanceToInitiateWorkspaceCycling) {
+ double distance_to_initiate_cycling = Config::GetDouble(
+ Config::DISTANCE_TO_INITIATE_CYCLING);
+
+ if (fabs(scroll_x_) > distance_to_initiate_cycling) {
// Only initiate workspace cycling if there recently was a significant
// amount of vertical movement as opposed to vertical movement
// accumulated over a long horizontal three finger scroll.
@@ -144,7 +147,7 @@ void WorkspaceCycler::OnScrollEvent(ui::ScrollEvent* event) {
scroll_y_ = 0.0f;
}
- if (fabs(scroll_y_) >= kDistanceToInitiateWorkspaceCycling)
+ if (fabs(scroll_y_) >= distance_to_initiate_cycling)
SetState(STARTING_CYCLING);
}

Powered by Google App Engine
This is Rietveld 408576698