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

Unified Diff: ash/common/system/tray/tray_details_view.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 side-by-side diff with in-line comments
Download patch
Index: ash/common/system/tray/tray_details_view.h
diff --git a/ash/common/system/tray/tray_details_view.h b/ash/common/system/tray/tray_details_view.h
index b1560053dbb2d37b6a9af2841395246bb8c3bb89..4ec4b4a43659a7be33264ef33b7c3af542935747 100644
--- a/ash/common/system/tray/tray_details_view.h
+++ b/ash/common/system/tray/tray_details_view.h
@@ -5,13 +5,20 @@
#ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_
#define ASH_COMMON_SYSTEM_TRAY_TRAY_DETAILS_VIEW_H_
+#include <memory>
+
#include "ash/ash_export.h"
#include "ash/common/system/tray/special_popup_row.h"
+#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/view_click_listener.h"
#include "base/macros.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/view.h"
+namespace base {
+class OneShotTimer;
+} // namespace base
+
namespace views {
class BoxLayout;
class ScrollView;
@@ -89,8 +96,14 @@ class ASH_EXPORT TrayDetailsView : public views::View,
// Transition to default view from details view. If |title_row_| has focus
// before transition, the default view should focus on the owner of this
// details view.
+ //
+ // In Material Design the actual transition is intentionally delayed to allow
+ // the user to perceive the ink drop animation on the clicked target.
void TransitionToDefaultView();
+ // Actually transitions to the default view.
+ void DoTransitionToDefaultView();
+
SystemTrayItem* owner_;
views::BoxLayout* box_layout_;
SpecialPopupRow* title_row_;
@@ -103,6 +116,9 @@ class ASH_EXPORT TrayDetailsView : public views::View,
// The back button that appears in the material design title row. Not owned.
views::Button* back_button_;
+ // Used to delay the transition to the default view.
+ std::unique_ptr<base::OneShotTimer> transition_delay_timer_;
+
DISALLOW_COPY_AND_ASSIGN(TrayDetailsView);
};

Powered by Google App Engine
This is Rietveld 408576698