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

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

Issue 2930123002: Tablet WM : Swiping on system tray bubble. (Closed)
Patch Set: Fixed UT. 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
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..b5fe099fcaffc36ab8f32353c3c7536647913b95 100644
--- a/ash/system/tray/system_tray.h
+++ b/ash/system/tray/system_tray.h
@@ -47,6 +47,9 @@ enum BubbleCreationType {
class ASH_EXPORT SystemTray : public TrayBackgroundView,
public views::TrayBubbleView::Delegate {
public:
+ // The threshold of the velocity of the fling event.
+ static constexpr float kFlingVelocity = 100.0f;
+
explicit SystemTray(Shelf* shelf);
~SystemTray() override;
@@ -142,6 +145,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 +201,37 @@ 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);
+
+ // Update the bounds of the system tray bubble according to |location|. Note
+ // that |location| is in the local coordinate space of |this|.
+ void SetBubbleBounds(const gfx::Point& location);
+
+ // Return true if the system bubble should be shown (i.e., animated upward to
+ // be made fully visible) after a sequence of scroll events terminated by
+ // |sequence_end|. Otherwise return false, indicating that the
tdanderson 2017/06/26 18:13:02 nit: re-name the |gesture| parameter here to |sequ
minch1 2017/06/26 23:26:48 Done.
+ // partially-visible system bubble should be animated downward and made fully
+ // hidden.
+ bool ShouldShowSystemBubbleAfterScrollSequence(
+ const ui::GestureEvent& gesture);
+
+ // 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;
+
+ // Swiping on the system tray can open the system tray bubble. True if it is
+ // during gesture dragging.
tdanderson 2017/06/26 18:13:02 Suggestion for a reword here: "True if the user is
minch1 2017/06/26 23:26:48 Done.
+ bool is_in_drag_ = false;
+
// The web notification tray view that appears adjacent to this view.
WebNotificationTray* web_notification_tray_ = nullptr;

Powered by Google App Engine
This is Rietveld 408576698