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..2d65e9e5af70dd05bf40a1b73b6ab10a4d62c064 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[]; |
@@ -46,6 +48,7 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView, |
void ChildPreferredSizeChanged(views::View* child) override; |
void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
void AboutToRequestFocusFromTabTraversal(bool reverse) override; |
+ void OnGestureEvent(ui::GestureEvent* event) override; |
msw
2017/07/17 19:28:01
nit: reorder this and the definition to match view
minch1
2017/07/17 20:41:11
Done.
|
// 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. |
+ virtual views::TrayBubbleView* GetBubbleView(); |
+ |
+ // Closes the associated tray bubble view if it is currently showing. |
+ virtual void CloseBubble() {} |
+ |
+ // Shows the associated tray bubble. |
+ 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_; |