Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(663)

Unified Diff: ash/system/tray/system_tray.h

Issue 2930123002: Tablet WM : Swiping on system tray bubble. (Closed)
Patch Set: Addressed comments. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/system/tray/system_tray.cc » ('j') | ash/system/tray/system_tray.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | ash/system/tray/system_tray.cc » ('j') | ash/system/tray/system_tray.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698