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

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

Issue 2961313003: Touch gestures for System Tray/ IME/ Stylus/ Notifications (Closed)
Patch Set: Fixed msw's comments. Created 3 years, 5 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/tray_background_view.h
diff --git a/ash/system/tray/tray_background_view.h b/ash/system/tray/tray_background_view.h
index 04294179742e0a3b4ec99b50e2853a6decbd3f9d..0075f94d1fe6e031b7f60f2abb8b4c7646f8a78d 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"
@@ -53,6 +54,15 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView,
const override;
void PaintButtonContents(gfx::Canvas* canvas) 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 +110,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:
@@ -110,6 +124,8 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView,
void HandlePerformActionResult(bool action_performed,
const ui::Event& event) override;
+ TrayDragController* drag_controller() { return drag_controller_.get(); }
+
private:
class TrayWidgetObserver;
@@ -145,6 +161,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_;

Powered by Google App Engine
This is Rietveld 408576698