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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ 5 #ifndef ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_
6 #define ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ 6 #define ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
11 #include "ash/shelf/shelf_background_animator_observer.h" 11 #include "ash/shelf/shelf_background_animator_observer.h"
12 #include "ash/system/tray/actionable_view.h" 12 #include "ash/system/tray/actionable_view.h"
13 #include "ash/system/tray_drag_controller.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "ui/compositor/layer_animation_observer.h" 15 #include "ui/compositor/layer_animation_observer.h"
15 #include "ui/gfx/geometry/insets.h" 16 #include "ui/gfx/geometry/insets.h"
16 #include "ui/views/bubble/tray_bubble_view.h" 17 #include "ui/views/bubble/tray_bubble_view.h"
17 18
18 namespace ash { 19 namespace ash {
19 class Shelf; 20 class Shelf;
20 class TrayBackground; 21 class TrayBackground;
21 class TrayContainer; 22 class TrayContainer;
22 class TrayEventFilter; 23 class TrayEventFilter;
(...skipping 23 matching lines...) Expand all
46 void ChildPreferredSizeChanged(views::View* child) override; 47 void ChildPreferredSizeChanged(views::View* child) override;
47 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; 48 void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
48 void AboutToRequestFocusFromTabTraversal(bool reverse) override; 49 void AboutToRequestFocusFromTabTraversal(bool reverse) override;
49 50
50 // ActionableView: 51 // ActionableView:
51 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; 52 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
52 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() 53 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
53 const override; 54 const override;
54 void PaintButtonContents(gfx::Canvas* canvas) override; 55 void PaintButtonContents(gfx::Canvas* canvas) override;
55 56
57 // Gets the associated tray bubble view.
58 virtual views::TrayBubbleView* GetBubbleView();
59
60 // 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.
61 virtual void CloseBubble() {}
62
63 // Shows the associated tray bubble.
64 virtual void ShowBubble() {}
65
56 // Called whenever the shelf alignment changes. 66 // Called whenever the shelf alignment changes.
57 virtual void UpdateAfterShelfAlignmentChange(); 67 virtual void UpdateAfterShelfAlignmentChange();
58 68
59 // Called when the anchor (tray or bubble) may have moved or changed. 69 // Called when the anchor (tray or bubble) may have moved or changed.
60 virtual void AnchorUpdated() {} 70 virtual void AnchorUpdated() {}
61 71
62 // Called from GetAccessibleNodeData, must return a valid accessible name. 72 // Called from GetAccessibleNodeData, must return a valid accessible name.
63 virtual base::string16 GetAccessibleNameForTray() = 0; 73 virtual base::string16 GetAccessibleNameForTray() = 0;
64 74
65 // Called when the bubble is resized. 75 // Called when the bubble is resized.
(...skipping 27 matching lines...) Expand all
93 void set_separator_visibility(bool visible) { separator_visible_ = visible; } 103 void set_separator_visibility(bool visible) { separator_visible_ = visible; }
94 104
95 // Gets the anchor for bubbles, which is tray_container(). 105 // Gets the anchor for bubbles, which is tray_container().
96 views::View* GetBubbleAnchor() const; 106 views::View* GetBubbleAnchor() const;
97 107
98 // Gets additional insets for positioning bubbles relative to 108 // Gets additional insets for positioning bubbles relative to
99 // tray_container(). 109 // tray_container().
100 gfx::Insets GetBubbleAnchorInsets() const; 110 gfx::Insets GetBubbleAnchorInsets() const;
101 111
102 // Returns the container window for the bubble (on the proper display). 112 // Returns the container window for the bubble (on the proper display).
103 aura::Window* GetBubbleWindowContainer() const; 113 aura::Window* GetBubbleWindowContainer();
114
115 // Update the bounds of the associated tray bubble. Close the bubble if
116 // |close_bubble| is set.
117 void AnimateToTargetBounds(const gfx::Rect& target_bounds, bool close_bubble);
104 118
105 protected: 119 protected:
106 // ActionableView: 120 // ActionableView:
107 std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override; 121 std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override;
108 bool ShouldEnterPushedState(const ui::Event& event) override; 122 bool ShouldEnterPushedState(const ui::Event& event) override;
109 bool PerformAction(const ui::Event& event) override; 123 bool PerformAction(const ui::Event& event) override;
110 void HandlePerformActionResult(bool action_performed, 124 void HandlePerformActionResult(bool action_performed,
111 const ui::Event& event) override; 125 const ui::Event& event) override;
112 126
127 TrayDragController* drag_controller() { return drag_controller_.get(); }
128
113 private: 129 private:
114 class TrayWidgetObserver; 130 class TrayWidgetObserver;
115 131
116 // ui::ImplicitAnimationObserver: 132 // ui::ImplicitAnimationObserver:
117 void OnImplicitAnimationsCompleted() override; 133 void OnImplicitAnimationsCompleted() override;
118 bool RequiresNotificationWhenAnimatorDestroyed() const override; 134 bool RequiresNotificationWhenAnimatorDestroyed() const override;
119 135
120 // Applies transformations to the |layer()| to animate the view when 136 // Applies transformations to the |layer()| to animate the view when
121 // SetVisible(false) is called. 137 // SetVisible(false) is called.
122 void HideTransformation(); 138 void HideTransformation();
(...skipping 15 matching lines...) Expand all
138 TrayBackground* background_; 154 TrayBackground* background_;
139 155
140 // Determines if the view is active. This changes how the ink drop ripples 156 // Determines if the view is active. This changes how the ink drop ripples
141 // behave. 157 // behave.
142 bool is_active_; 158 bool is_active_;
143 159
144 // Visibility of this tray's separator which is a line of 1x32px and 4px to 160 // Visibility of this tray's separator which is a line of 1x32px and 4px to
145 // right of tray. 161 // right of tray.
146 bool separator_visible_; 162 bool separator_visible_;
147 163
164 // 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.
165 // associated bubble, or dragging that happend on the associated tray bubble
166 // to close it.
167 std::unique_ptr<TrayDragController> drag_controller_;
168
169 // Used in maximize mode to make sure the system tray bubble only be shown in
170 // work area.
171 std::unique_ptr<aura::Window> clipping_window_;
172
148 std::unique_ptr<TrayWidgetObserver> widget_observer_; 173 std::unique_ptr<TrayWidgetObserver> widget_observer_;
149 std::unique_ptr<TrayEventFilter> tray_event_filter_; 174 std::unique_ptr<TrayEventFilter> tray_event_filter_;
150 175
151 DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView); 176 DISALLOW_COPY_AND_ASSIGN(TrayBackgroundView);
152 }; 177 };
153 178
154 } // namespace ash 179 } // namespace ash
155 180
156 #endif // ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_ 181 #endif // ASH_SYSTEM_TRAY_TRAY_BACKGROUND_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698