Chromium Code Reviews| Index: ash/system/tray/tray_background_view.h |
| diff --git a/ash/system/tray/tray_background_view.h b/ash/system/tray/tray_background_view.h |
| index 04294179742e0a3b4ec99b50e2853a6decbd3f9d..530d94fe2b6822c9ee393513b6a7168371d2a3ea 100644 |
| --- a/ash/system/tray/tray_background_view.h |
| +++ b/ash/system/tray/tray_background_view.h |
| @@ -10,6 +10,7 @@ |
| #include "ash/ash_export.h" |
| #include "ash/shelf/shelf_background_animator_observer.h" |
| #include "ash/system/tray/actionable_view.h" |
| +#include "ash/system/tray_drag_controller.h" |
| #include "base/macros.h" |
| #include "ui/compositor/layer_animation_observer.h" |
| #include "ui/gfx/geometry/insets.h" |
| @@ -27,7 +28,8 @@ class TrayEventFilter; |
| // PerformAction when clicked on. |
| class ASH_EXPORT TrayBackgroundView : public ActionableView, |
| public ui::ImplicitAnimationObserver, |
| - public ShelfBackgroundAnimatorObserver { |
| + public ShelfBackgroundAnimatorObserver, |
| + public views::TrayBubbleView::Delegate { |
| public: |
| static const char kViewClassName[]; |
| @@ -43,9 +45,10 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView, |
| // views::View: |
| void SetVisible(bool visible) override; |
| const char* GetClassName() const override; |
| - void ChildPreferredSizeChanged(views::View* child) override; |
| - void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
| + void OnGestureEvent(ui::GestureEvent* event) override; |
| void AboutToRequestFocusFromTabTraversal(bool reverse) override; |
| + void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
| + void ChildPreferredSizeChanged(views::View* child) override; |
| // ActionableView: |
| std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; |
| @@ -53,6 +56,18 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView, |
| const override; |
| void PaintButtonContents(gfx::Canvas* canvas) override; |
| + // TrayBubbleView::Delegate: |
| + bool ProcessGestureEventForBubble(ui::GestureEvent* event) override; |
| + |
| + // Gets the associated tray bubble view. |
|
tdanderson
2017/07/17 22:44:37
nit: "Returns the associated tray bubble view, if
minch1
2017/07/18 03:58:59
Done.
|
| + virtual views::TrayBubbleView* GetBubbleView(); |
| + |
|
tdanderson
2017/07/17 22:44:36
nit: "if it exists and is currently showing"
minch1
2017/07/18 03:58:59
Done.
|
| + // Closes the associated tray bubble view if it is currently showing. |
| + virtual void CloseBubble() {} |
|
tdanderson
2017/07/17 22:44:37
The no-op implementations of CloseBubble() and Sho
minch1
2017/07/18 03:58:59
Done.
|
| + |
| + // Shows the associated tray bubble. |
|
tdanderson
2017/07/17 22:44:37
nit: "if one exists"
minch1
2017/07/18 03:58:59
Done.
|
| + virtual void ShowBubble() {} |
| + |
| // Called whenever the shelf alignment changes. |
| virtual void UpdateAfterShelfAlignmentChange(); |
| @@ -100,7 +115,11 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView, |
| gfx::Insets GetBubbleAnchorInsets() const; |
| // Returns the container window for the bubble (on the proper display). |
| - aura::Window* GetBubbleWindowContainer() const; |
| + aura::Window* GetBubbleWindowContainer(); |
| + |
| + // Update the bounds of the associated tray bubble. Close the bubble if |
| + // |close_bubble| is set. |
| + void AnimateToTargetBounds(const gfx::Rect& target_bounds, bool close_bubble); |
| protected: |
| // ActionableView: |
| @@ -145,6 +164,13 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView, |
| // right of tray. |
| bool separator_visible_; |
| + // Handles touch drag gestures on the tray area and its associated bubble. |
| + std::unique_ptr<TrayDragController> drag_controller_; |
| + |
| + // Used in maximize mode to make sure the system tray bubble only be shown in |
| + // work area. |
| + std::unique_ptr<aura::Window> clipping_window_; |
| + |
| std::unique_ptr<TrayWidgetObserver> widget_observer_; |
| std::unique_ptr<TrayEventFilter> tray_event_filter_; |