summaryrefslogtreecommitdiffstats
path: root/ash/wm/gestures
diff options
context:
space:
mode:
authorsadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-04 22:16:10 +0000
committersadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-04 22:16:10 +0000
commit4982ee1e81b6dc26a6f675b2104d9e083b2fe9fb (patch)
tree54376f826a5ed5b488c78d84f3202dc2ebe52598 /ash/wm/gestures
parentb71f1f6946e77a95fab70d6bb0941c0c5544bc32 (diff)
downloadchromium_src-4982ee1e81b6dc26a6f675b2104d9e083b2fe9fb.zip
chromium_src-4982ee1e81b6dc26a6f675b2104d9e083b2fe9fb.tar.gz
chromium_src-4982ee1e81b6dc26a6f675b2104d9e083b2fe9fb.tar.bz2
ash: Allow the shelf to be dragged in from the bottom edge of the screen.
BUG=145406 Review URL: https://chromiumcodereview.appspot.com/10911075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154823 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/gestures')
-rw-r--r--ash/wm/gestures/bezel_gesture_handler.cc25
-rw-r--r--ash/wm/gestures/bezel_gesture_handler.h4
-rw-r--r--ash/wm/gestures/shelf_gesture_handler.cc2
3 files changed, 18 insertions, 13 deletions
diff --git a/ash/wm/gestures/bezel_gesture_handler.cc b/ash/wm/gestures/bezel_gesture_handler.cc
index 3534e77..cf783df 100644
--- a/ash/wm/gestures/bezel_gesture_handler.cc
+++ b/ash/wm/gestures/bezel_gesture_handler.cc
@@ -72,6 +72,11 @@ void BezelGestureHandler::ProcessGestureEvent(aura::Window* target,
switch (event.type()) {
case ui::ET_GESTURE_SCROLL_BEGIN:
HandleBezelGestureStart(target, event);
+
+ // TODO(sad|skuhne): Fix the bezel gestures for when the shelf is on the
+ // left/right of the screen.
+ if (start_location_ == BEZEL_START_BOTTOM)
+ shelf_handler_.ProcessGestureEvent(event);
break;
case ui::ET_GESTURE_SCROLL_UPDATE:
// Check if a valid start position has been set.
@@ -82,6 +87,9 @@ void BezelGestureHandler::ProcessGestureEvent(aura::Window* target,
HandleBezelGestureUpdate(target, event);
break;
case ui::ET_GESTURE_SCROLL_END:
+ case ui::ET_SCROLL_FLING_START:
+ if (start_location_ == BEZEL_START_BOTTOM)
+ shelf_handler_.ProcessGestureEvent(event);
HandleBezelGestureEnd();
break;
default:
@@ -120,18 +128,11 @@ bool BezelGestureHandler::HandleDeviceControl(
return false;
}
-bool BezelGestureHandler::HandleLauncherControl(
- const ui::GestureEvent& event) {
- if (start_location_ == BEZEL_START_BOTTOM &&
- event.details().scroll_y() < 0) {
- ash::AcceleratorController* accelerator =
- ash::Shell::GetInstance()->accelerator_controller();
- accelerator->PerformAction(FOCUS_LAUNCHER, ui::Accelerator());
- } else {
- return false;
- }
- // No further notifications for this gesture.
- return true;
+bool BezelGestureHandler::HandleLauncherControl(const ui::GestureEvent& event) {
+ CHECK_EQ(BEZEL_START_BOTTOM, start_location_);
+ shelf_handler_.ProcessGestureEvent(event);
+ return event.type() == ui::ET_GESTURE_SCROLL_END ||
+ event.type() == ui::ET_SCROLL_FLING_START;
}
bool BezelGestureHandler::HandleApplicationControl(
diff --git a/ash/wm/gestures/bezel_gesture_handler.h b/ash/wm/gestures/bezel_gesture_handler.h
index 3fd57e0..db8163e 100644
--- a/ash/wm/gestures/bezel_gesture_handler.h
+++ b/ash/wm/gestures/bezel_gesture_handler.h
@@ -7,6 +7,8 @@
#include "base/basictypes.h"
+#include "ash/wm/gestures/shelf_gesture_handler.h"
+
namespace aura {
class Window;
}
@@ -114,6 +116,8 @@ class BezelGestureHandler {
// True if device control bezel operations (brightness, volume) are enabled.
bool enable_bezel_device_control_;
+ ShelfGestureHandler shelf_handler_;
+
DISALLOW_COPY_AND_ASSIGN(BezelGestureHandler);
};
diff --git a/ash/wm/gestures/shelf_gesture_handler.cc b/ash/wm/gestures/shelf_gesture_handler.cc
index 545a4c3..866ddcb 100644
--- a/ash/wm/gestures/shelf_gesture_handler.cc
+++ b/ash/wm/gestures/shelf_gesture_handler.cc
@@ -52,7 +52,7 @@ bool ShelfGestureHandler::ProcessGestureEvent(const ui::GestureEvent& event) {
if (event.type() == ui::ET_GESTURE_SCROLL_END ||
event.type() == ui::ET_SCROLL_FLING_START) {
- shelf->HideFromGestureDrag(event);
+ shelf->CompleteGestureDrag(event);
return true;
}