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

Unified Diff: ash/system/session_length_limit/tray_session_length_limit.cc

Issue 23464044: Prevents session_length_timeout reappearing when it's already dismissed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/session_length_limit/tray_session_length_limit.cc
diff --git a/ash/system/session_length_limit/tray_session_length_limit.cc b/ash/system/session_length_limit/tray_session_length_limit.cc
index af32635bb9b5f1a1036309c53e79d66030b81ad6..90b088d1602e9a9338c27807267aee86f40e403d 100644
--- a/ash/system/session_length_limit/tray_session_length_limit.cc
+++ b/ash/system/session_length_limit/tray_session_length_limit.cc
@@ -78,6 +78,15 @@ base::string16 FormatRemainingSessionTimeNotification(
void CreateOrUpdateNotification(const base::TimeDelta& remaining_time,
bool enable_spoken_feedback) {
+ message_center::MessageCenter* message_center =
+ message_center::MessageCenter::Get();
+ // If |enable_spoken_feedback| is false, it's just an update of the content,
+ // which should not create a new one if it's already closed.
stevenjb 2013/09/09 17:58:03 nit: s/one/notification
Jun Mukai 2013/09/09 19:37:25 Done.
+ if (!enable_spoken_feedback &&
+ !message_center->HasNotification(kSessionLengthTimeoutNotificationId)) {
stevenjb 2013/09/09 17:58:03 This seems awkward; we're effectively using 'enabl
Jun Mukai 2013/09/09 19:37:25 I don't think I need to separate the function / lo
stevenjb 2013/09/09 19:43:07 OK, that's more clear now.
+ return;
+ }
+
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
message_center::RichNotificationData data;
data.should_make_spoken_feedback_for_popup_updates = enable_spoken_feedback;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698