Index: ash/system/tray/system_tray.h |
diff --git a/ash/system/tray/system_tray.h b/ash/system/tray/system_tray.h |
index fa16c53f74067aaee8e1eacaccff91add8d1d17d..dd9790d36806e082e03787c583f10971ec8b9c95 100644 |
--- a/ash/system/tray/system_tray.h |
+++ b/ash/system/tray/system_tray.h |
@@ -142,6 +142,11 @@ class ASH_EXPORT SystemTray : public TrayBackgroundView, |
// Activates the system tray bubble. |
void ActivateBubble(); |
+ // ui::EventHandler: |
+ void OnGestureEvent(ui::GestureEvent* event) override; |
+ |
+ gfx::Rect GetWorkAreaBoundsInScreen() const; |
+ |
private: |
friend class SystemTrayTestApi; |
class ActivationObserver; |
@@ -193,6 +198,36 @@ class ASH_EXPORT SystemTray : public TrayBackgroundView, |
// Overridden from ActionableView. |
bool PerformAction(const ui::Event& event) override; |
+ // Gesture related functions: |
+ bool ProcessGestureEvent(const ui::GestureEvent& event); |
+ bool StartGestureDrag(const ui::GestureEvent& gesture); |
+ void UpdateGestureDrag(const ui::GestureEvent& gesture); |
+ void CompleteGestureDrag(const ui::GestureEvent& gesture); |
+ |
+ // Returns true if swiping down triggered on the system tray area on the |
+ // shelf. |
+ bool IsDraggingDownOnShelf(const ui::GestureEvent& gesture); |
+ |
+ // Update the bounds of the system tray bubble according to the location of |
+ // the gesture drag. |
+ void UpdateBoundsOnDragging(const ui::GestureEvent& gesture); |
+ |
+ // For SCROLL event, open the system tray bubble if the drag amount is larger |
+ // than one third of the height of the bubble. Otherwise, close it. For FLING |
+ // event. If the fling velocity is larger than 100.0 dips/sec, open or close |
+ // the bubble depends on the fling direction. Otherwise, the rule is the same |
+ // as SCROLL event. |
+ bool ShouldShowSystemBubbleForDragging(const ui::GestureEvent& gesture); |
tdanderson
2017/06/20 22:42:28
With the current implementation, once the system m
minch1
2017/06/22 17:42:11
Done.
|
+ |
+ // Shelf the system tray is in. |
+ Shelf* const shelf_; |
+ |
+ // The original bounds of the system tray bubble. |
+ gfx::Rect system_tray_bubble_bounds_; |
+ |
+ // Tracks the amount of the drag. |
+ float gesture_drag_amount_ = 0.f; |
+ |
// The web notification tray view that appears adjacent to this view. |
WebNotificationTray* web_notification_tray_ = nullptr; |