summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-28 22:02:50 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-28 22:02:50 +0000
commit1d9bb9cd24a4c89ffb0df9ba2e79f811e7d97620 (patch)
tree2076e2db2d5c1d77018b95dd236fed5f0424cbd2 /ash
parent30f314c3b2cdf618ebed5c6a45c43e529ee25c4d (diff)
downloadchromium_src-1d9bb9cd24a4c89ffb0df9ba2e79f811e7d97620.zip
chromium_src-1d9bb9cd24a4c89ffb0df9ba2e79f811e7d97620.tar.gz
chromium_src-1d9bb9cd24a4c89ffb0df9ba2e79f811e7d97620.tar.bz2
ash: Put advanced wm gestures behind a flag.
BUG=145048 Review URL: https://chromiumcodereview.appspot.com/10871098 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153752 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/ash_switches.cc3
-rw-r--r--ash/ash_switches.h1
-rw-r--r--ash/wm/system_gesture_event_filter.cc8
-rw-r--r--ash/wm/system_gesture_event_filter.h2
-rw-r--r--ash/wm/system_gesture_event_filter_unittest.cc11
5 files changed, 23 insertions, 2 deletions
diff --git a/ash/ash_switches.cc b/ash/ash_switches.cc
index 5eca1ce..538a687 100644
--- a/ash/ash_switches.cc
+++ b/ash/ash_switches.cc
@@ -10,6 +10,9 @@ namespace switches {
// Enable keyboard shortcuts useful for debugging.
const char kAshDebugShortcuts[] = "ash-debug-shortcuts";
+// Enable advanced gestures (e.g. for window management).
+const char kAshEnableAdvancedGestures[] = "ash-enable-advanced-gestures";
+
// Enables the Oak tree viewer.
const char kAshEnableOak[] = "ash-enable-oak";
diff --git a/ash/ash_switches.h b/ash/ash_switches.h
index 4480359..726520f3 100644
--- a/ash/ash_switches.h
+++ b/ash/ash_switches.h
@@ -16,6 +16,7 @@ namespace switches {
// Please keep alphabetized.
ASH_EXPORT extern const char kAshDebugShortcuts[];
+ASH_EXPORT extern const char kAshEnableAdvancedGestures[];
ASH_EXPORT extern const char kAshEnableOak[];
ASH_EXPORT extern const char kAshEnableWorkspace2[];
ASH_EXPORT extern const char kAshExtendedDesktopDisabled[];
diff --git a/ash/wm/system_gesture_event_filter.cc b/ash/wm/system_gesture_event_filter.cc
index a56ec1a..b8aa478 100644
--- a/ash/wm/system_gesture_event_filter.cc
+++ b/ash/wm/system_gesture_event_filter.cc
@@ -6,6 +6,7 @@
#include "ash/accelerators/accelerator_controller.h"
#include "ash/accelerators/accelerator_table.h"
+#include "ash/ash_switches.h"
#include "ash/display/display_controller.h"
#include "ash/launcher/launcher.h"
#include "ash/root_window_controller.h"
@@ -597,6 +598,8 @@ SystemGestureEventFilter::SystemGestureEventFilter()
start_location_(BEZEL_START_UNSET),
orientation_(SCROLL_ORIENTATION_UNSET),
is_scrubbing_(false),
+ system_gestures_enabled_(CommandLine::ForCurrentProcess()->
+ HasSwitch(ash::switches::kAshEnableAdvancedGestures)),
long_press_affordance_(new LongPressAffordanceAnimation) {
}
@@ -655,6 +658,9 @@ ui::GestureStatus SystemGestureEventFilter::PreHandleGestureEvent(
return ui::GESTURE_STATUS_CONSUMED;
}
+ if (!system_gestures_enabled_)
+ return ui::GESTURE_STATUS_UNKNOWN;
+
aura::Window* system_target = GetTargetForSystemGestureEvent(target);
if (!system_target)
return ui::GESTURE_STATUS_UNKNOWN;
@@ -831,7 +837,7 @@ void SystemGestureEventFilter::HandleBezelGestureUpdate(
} else {
// Check if device gestures should be performed or not.
if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableBezelTouch)) {
+ ::switches::kDisableBezelTouch)) {
start_location_ = BEZEL_START_UNSET;
return;
}
diff --git a/ash/wm/system_gesture_event_filter.h b/ash/wm/system_gesture_event_filter.h
index 8fabe52..a67fb31 100644
--- a/ash/wm/system_gesture_event_filter.h
+++ b/ash/wm/system_gesture_event_filter.h
@@ -189,6 +189,8 @@ class SystemGestureEventFilter : public aura::EventFilter,
// A device swipe gesture is in progress.
bool is_scrubbing_;
+ bool system_gestures_enabled_;
+
// To suppress random noise in the bezel area, the stroke needs to have at
// least a certain amount of events in close proximity before it gets used.
// This is the counter which keeps track of the number of events passed.
diff --git a/ash/wm/system_gesture_event_filter_unittest.cc b/ash/wm/system_gesture_event_filter_unittest.cc
index 3deae94..1660731 100644
--- a/ash/wm/system_gesture_event_filter_unittest.cc
+++ b/ash/wm/system_gesture_event_filter_unittest.cc
@@ -4,8 +4,8 @@
#include "ash/wm/system_gesture_event_filter.h"
-#include "base/timer.h"
#include "ash/accelerators/accelerator_controller.h"
+#include "ash/ash_switches.h"
#include "ash/launcher/launcher.h"
#include "ash/launcher/launcher_model.h"
#include "ash/shell.h"
@@ -15,7 +15,9 @@
#include "ash/test/test_launcher_delegate.h"
#include "ash/volume_control_delegate.h"
#include "ash/wm/window_util.h"
+#include "base/command_line.h"
#include "base/time.h"
+#include "base/timer.h"
#include "ui/aura/root_window.h"
#include "ui/aura/test/event_generator.h"
#include "ui/aura/test/test_windows.h"
@@ -146,6 +148,13 @@ class SystemGestureEventFilterTest : public AshTestBase {
GetLongPressAffordance()->view_.get());
}
+ // Overridden from AshTestBase:
+ virtual void SetUp() OVERRIDE {
+ CommandLine::ForCurrentProcess()->AppendSwitch(
+ ash::switches::kAshEnableAdvancedGestures);
+ test::AshTestBase::SetUp();
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(SystemGestureEventFilterTest);
};