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

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

Issue 2961313003: Touch gestures for System Tray/ IME/ Stylus/ Notifications (Closed)
Patch Set: Fixed UT. 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..17f4670eb693486196c22472dcf3015f785b859b 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 the bubble view has been shown.
msw 2017/07/14 02:00:46 nit: "if it is currently showing."?
minch1 2017/07/14 19:45:18 Done.
+ 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,15 @@ class ASH_EXPORT TrayBackgroundView : public ActionableView,
// right of tray.
bool separator_visible_;
+ // Used to process the dragging that happend on the tray area to show the
msw 2017/07/14 02:00:46 nit: "Handles touch drag gestures on the tray area
minch1 2017/07/14 19:45:18 Done.
+ // associated bubble, or dragging that happend on the associated tray bubble
+ // to close it.
+ 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