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

Unified 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: Addressed danakj@ comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/common/system/tray/system_tray_item.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/system_tray_item.h
diff --git a/ash/common/system/tray/system_tray_item.h b/ash/common/system/tray/system_tray_item.h
index c1e6aaba425844280a9c054f7770a1e762d53782..854bd2342aca980214e68f97285ecf80d60968e0 100644
--- a/ash/common/system/tray/system_tray_item.h
+++ b/ash/common/system/tray/system_tray_item.h
@@ -5,11 +5,17 @@
#ifndef ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_
#define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_ITEM_H_
+#include <memory>
+
#include "ash/ash_export.h"
#include "ash/common/login_status.h"
#include "ash/public/cpp/shelf_types.h"
#include "base/macros.h"
+namespace base {
+class OneShotTimer;
+} // namespace base
+
namespace views {
class View;
}
@@ -105,8 +111,9 @@ class ASH_EXPORT SystemTrayItem {
// currently visible, then making this call would use the existing window to
// display the detailed item. The detailed item will inherit the bounds of the
// existing window.
- // If there is no existing view, then this is equivalent to calling
- // PopupDetailedView(0, true).
+ //
+ // In Material Design the actual transition is intentionally delayed to allow
+ // the user to perceive the ink drop animation on the clicked target.
void TransitionDetailedView();
// Pops up the detailed view for this item. An item can request to show its
@@ -142,6 +149,9 @@ class ASH_EXPORT SystemTrayItem {
void set_restore_focus(bool restore_focus) { restore_focus_ = restore_focus; }
private:
+ // Actually transitions to the detailed view.
+ void DoTransitionToDetailedView();
+
// Accesses uma_type().
friend class SystemTrayBubble;
@@ -151,6 +161,9 @@ class ASH_EXPORT SystemTrayItem {
UmaType uma_type_;
bool restore_focus_;
+ // Used to delay the transition to the detailed view.
+ std::unique_ptr<base::OneShotTimer> transition_delay_timer_;
+
DISALLOW_COPY_AND_ASSIGN(SystemTrayItem);
};
« no previous file with comments | « no previous file | ash/common/system/tray/system_tray_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698