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

Unified Diff: ash/common/system/tray/system_tray_item.cc

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/system_tray_item.h ('k') | ash/common/system/tray/tray_constants.h » ('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.cc
diff --git a/ash/common/system/tray/system_tray_item.cc b/ash/common/system/tray/system_tray_item.cc
index 518c1aef22dad24996afbfe1feaf0526587e485c..164a0e419ecc6490163790e075a73de4010549cd 100644
--- a/ash/common/system/tray/system_tray_item.cc
+++ b/ash/common/system/tray/system_tray_item.cc
@@ -6,6 +6,8 @@
#include "ash/common/system/tray/system_tray.h"
#include "ash/common/system/tray/system_tray_delegate.h"
+#include "ash/common/system/tray/tray_constants.h"
+#include "base/timer/timer.h"
#include "ui/views/view.h"
namespace ash {
@@ -40,7 +42,16 @@ void SystemTrayItem::DestroyDetailedView() {}
void SystemTrayItem::DestroyNotificationView() {}
void SystemTrayItem::TransitionDetailedView() {
- system_tray()->ShowDetailedView(this, 0, true, BUBBLE_USE_EXISTING);
+ const int transition_delay =
+ GetTrayConstant(TRAY_POPUP_TRANSITION_TO_DETAILED_DELAY);
+ if (transition_delay <= 0) {
+ DoTransitionToDetailedView();
+ return;
+ }
+ transition_delay_timer_.reset(new base::OneShotTimer());
+ transition_delay_timer_->Start(
+ FROM_HERE, base::TimeDelta::FromMilliseconds(transition_delay), this,
+ &SystemTrayItem::DoTransitionToDetailedView);
}
void SystemTrayItem::UpdateAfterLoginStatusChange(LoginStatus status) {}
@@ -73,4 +84,9 @@ bool SystemTrayItem::ShouldShowShelf() const {
return true;
}
+void SystemTrayItem::DoTransitionToDetailedView() {
+ transition_delay_timer_.reset();
+ system_tray()->ShowDetailedView(this, 0, true, BUBBLE_USE_EXISTING);
+}
+
} // namespace ash
« no previous file with comments | « ash/common/system/tray/system_tray_item.h ('k') | ash/common/system/tray/tray_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698