Index: ash/wm/workspace/workspace_cycler.cc |
diff --git a/ash/wm/workspace/workspace_cycler.cc b/ash/wm/workspace/workspace_cycler.cc |
index 5015fff092d2751c68333ac005200dbf8a121e1f..d7e7d6b72947266f5b794ac2b7add5f595f65c8e 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. |
@@ -133,7 +133,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. |
@@ -141,7 +144,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); |
} |