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

Side by Side Diff: ash/common/system/tray/system_tray_item.h

Issue 2494943005: [ash-md] Added a delay between system menu default/detailed view transitions. (Closed)
Patch Set: Created 4 years, 1 month 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
tdanderson 2016/11/13 20:09:02 don't forget to have something in the BUG= line.
bruthig 2016/11/13 20:47:51 Done.
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ 5 #ifndef ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_
6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ 6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_
7 7
8 #include <memory>
9
8 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
9 #include "ash/common/login_status.h" 11 #include "ash/common/login_status.h"
10 #include "ash/public/cpp/shelf_types.h" 12 #include "ash/public/cpp/shelf_types.h"
11 #include "base/macros.h" 13 #include "base/macros.h"
12 14
15 namespace base {
16 class OneShotTimer;
17 } // namespace base
18
13 namespace views { 19 namespace views {
14 class View; 20 class View;
15 } 21 }
16 22
17 namespace ash { 23 namespace ash {
18 class SystemTray; 24 class SystemTray;
19 class SystemTrayBubble; 25 class SystemTrayBubble;
20 class TrayItemView; 26 class TrayItemView;
21 27
22 class ASH_EXPORT SystemTrayItem { 28 class ASH_EXPORT SystemTrayItem {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 virtual void UpdateAfterLoginStatusChange(LoginStatus status); 104 virtual void UpdateAfterLoginStatusChange(LoginStatus status);
99 105
100 // Updates the tray view (if applicable) when shelf's alignment changes. 106 // Updates the tray view (if applicable) when shelf's alignment changes.
101 // The default implementation does nothing. 107 // The default implementation does nothing.
102 virtual void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment); 108 virtual void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment);
103 109
104 // Shows the detailed view for this item. If the main popup for the tray is 110 // Shows the detailed view for this item. If the main popup for the tray is
105 // currently visible, then making this call would use the existing window to 111 // currently visible, then making this call would use the existing window to
106 // display the detailed item. The detailed item will inherit the bounds of the 112 // display the detailed item. The detailed item will inherit the bounds of the
107 // existing window. 113 // existing window.
108 // If there is no existing view, then this is equivalent to calling 114 //
109 // PopupDetailedView(0, true). 115 // In Material Design the actual transition is intentionally delayed to allow
116 // the user to perceive the ink drop animation on the clicked target.
110 void TransitionDetailedView(); 117 void TransitionDetailedView();
111 118
112 // Pops up the detailed view for this item. An item can request to show its 119 // Pops up the detailed view for this item. An item can request to show its
113 // detailed view using this function (e.g. from an observer callback when 120 // detailed view using this function (e.g. from an observer callback when
114 // something, e.g. volume, network availability etc. changes). If 121 // something, e.g. volume, network availability etc. changes). If
115 // |for_seconds| is non-zero, then the popup is closed after the specified 122 // |for_seconds| is non-zero, then the popup is closed after the specified
116 // time. 123 // time.
117 void PopupDetailedView(int for_seconds, bool activate); 124 void PopupDetailedView(int for_seconds, bool activate);
118 125
119 // Continue showing the currently-shown detailed view, if any, for 126 // Continue showing the currently-shown detailed view, if any, for
(...skipping 18 matching lines...) Expand all
138 // the shelf is in the auto-hide state. Default is true. 145 // the shelf is in the auto-hide state. Default is true.
139 virtual bool ShouldShowShelf() const; 146 virtual bool ShouldShowShelf() const;
140 147
141 // Returns the system tray that this item belongs to. 148 // Returns the system tray that this item belongs to.
142 SystemTray* system_tray() const { return system_tray_; } 149 SystemTray* system_tray() const { return system_tray_; }
143 150
144 bool restore_focus() const { return restore_focus_; } 151 bool restore_focus() const { return restore_focus_; }
145 void set_restore_focus(bool restore_focus) { restore_focus_ = restore_focus; } 152 void set_restore_focus(bool restore_focus) { restore_focus_ = restore_focus; }
146 153
147 private: 154 private:
155 // Actually transitions to the detailed view.
156 void DoTransitionToDetailedView();
157
148 // Accesses uma_type(). 158 // Accesses uma_type().
149 friend class SystemTrayBubble; 159 friend class SystemTrayBubble;
150 160
151 UmaType uma_type() const { return uma_type_; } 161 UmaType uma_type() const { return uma_type_; }
152 162
153 SystemTray* system_tray_; 163 SystemTray* system_tray_;
154 UmaType uma_type_; 164 UmaType uma_type_;
155 bool restore_focus_; 165 bool restore_focus_;
156 166
167 // Used to delay the transition to the detailed view.
168 std::unique_ptr<base::OneShotTimer> transition_delay_timer_;
169
157 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem); 170 DISALLOW_COPY_AND_ASSIGN(SystemTrayItem);
158 }; 171 };
159 172
160 } // namespace ash 173 } // namespace ash
161 174
162 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_ 175 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_
OLDNEW
« no previous file with comments | « no previous file | ash/common/system/tray/system_tray_item.cc » ('j') | ash/common/system/tray/tray_constants.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698