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

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: 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 | « ash/common/system/tray/tray_constants.cc ('k') | ash/common/system/tray/tray_details_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 003233959f2caa962d3e3d15dd1552c6fd800fca..3998d48fb78b6ee5fc994e652e3e1727808e2ef0 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 CustomButton;
@@ -110,8 +117,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();
+
// Helper function which creates and returns the back button used in the
// material design top-most header row. The caller assumes ownership of the
// returned button.
@@ -135,6 +148,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);
};
« no previous file with comments | « ash/common/system/tray/tray_constants.cc ('k') | ash/common/system/tray/tray_details_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698