diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-12 21:48:28 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-12 21:48:28 +0000 |
commit | c8e2e83cb082629c7b0823eab22bcd1e4b1e3aff (patch) | |
tree | dc6100bcd6a4587fb560c8f9dcca0af9d6d680d1 /ash/wm/gestures/tray_gesture_handler.h | |
parent | 1faf3472490808a0aba0660ed2b9bfe32eedcf60 (diff) | |
download | chromium_src-c8e2e83cb082629c7b0823eab22bcd1e4b1e3aff.zip chromium_src-c8e2e83cb082629c7b0823eab22bcd1e4b1e3aff.tar.gz chromium_src-c8e2e83cb082629c7b0823eab22bcd1e4b1e3aff.tar.bz2 |
ash: Show the default tray bubble when dragging the shelf from the right edge.
If the shelf is dragged from the bottom at the right edge of the screen,
then start showing the tray bubble with the drag.
BUG=146878
Review URL: https://chromiumcodereview.appspot.com/10913217
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156382 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/gestures/tray_gesture_handler.h')
-rw-r--r-- | ash/wm/gestures/tray_gesture_handler.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/ash/wm/gestures/tray_gesture_handler.h b/ash/wm/gestures/tray_gesture_handler.h new file mode 100644 index 0000000..7894ecf --- /dev/null +++ b/ash/wm/gestures/tray_gesture_handler.h @@ -0,0 +1,48 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_WM_GESTURES_TRAY_GESTURE_HANDLER_H_ +#define ASH_WM_GESTURES_TRAY_GESTURE_HANDLER_H_ + +#include "base/basictypes.h" +#include "base/compiler_specific.h" +#include "ui/views/widget/widget_observer.h" + +namespace ui { +class GestureEvent; +} + +namespace ash { +namespace internal { + +// Handles gesture events on the shelf to show the system tray bubble. +class TrayGestureHandler : public views::WidgetObserver { + public: + TrayGestureHandler(); + virtual ~TrayGestureHandler(); + + // Handles a gesture-update event and updates the dragging state of the tray + // bubble. Returns true if the handler can continue to process gesture events + // for the bubble. Returns false if it should no longer receive gesture + // events. + bool UpdateGestureDrag(const ui::GestureEvent& event); + + void CompleteGestureDrag(const ui::GestureEvent& event); + + private: + virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; + + // The widget for the tray-bubble. + views::Widget* widget_; + + // The amount that has been dragged. + float gesture_drag_amount_; + + DISALLOW_COPY_AND_ASSIGN(TrayGestureHandler); +}; + +} // namespace internal +} // namespace ash + +#endif // ASH_WM_GESTURES_TRAY_GESTURE_HANDLER_H_ |