Commit 0884f2dd authored by Ahmed Fakhry's avatar Ahmed Fakhry Committed by Commit Bot

Desks: Check the feature status before handling 3-finger horizontal gestures

This is the ToT version of the M-77 CL https://crrev.com/c/1773959.

TBR=sammiequon@chromium.org
BUG=998321

Change-Id: Id5acbb90947aa6b461ec6ef6086fc0f3e5c7d191
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1774198Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Commit-Queue: Ahmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691427}
parent 7489a6a0
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "ash/wm/gestures/wm_gesture_handler.h" #include "ash/wm/gestures/wm_gesture_handler.h"
#include "ash/public/cpp/ash_features.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/wm/desks/desks_controller.h" #include "ash/wm/desks/desks_controller.h"
#include "ash/wm/desks/desks_histogram_enums.h" #include "ash/wm/desks/desks_histogram_enums.h"
...@@ -44,6 +45,9 @@ bool Handle3FingerVerticalScroll(float scroll_y) { ...@@ -44,6 +45,9 @@ bool Handle3FingerVerticalScroll(float scroll_y) {
// Handles horizontal 3-finger scroll by switching desks if possible. // Handles horizontal 3-finger scroll by switching desks if possible.
// Returns true if the gesture was handled. // Returns true if the gesture was handled.
bool Handle3FingerHorizontalScroll(float scroll_x) { bool Handle3FingerHorizontalScroll(float scroll_x) {
if (!features::IsVirtualDesksEnabled())
return false;
if (std::fabs(scroll_x) < WmGestureHandler::kHorizontalThresholdDp) if (std::fabs(scroll_x) < WmGestureHandler::kHorizontalThresholdDp)
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment