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

Unified Diff: ui/message_center/views/notification_view_md.cc

Issue 2945303006: Add percentage of progress in notification header. (Closed)
Patch Set: Created 3 years, 6 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
Index: ui/message_center/views/notification_view_md.cc
diff --git a/ui/message_center/views/notification_view_md.cc b/ui/message_center/views/notification_view_md.cc
index 44eeb8d4b3f3af15fdb48372568ebc389bee598a..33e0c598c247397574ce0fa2ab2896a01b4d6b80 100644
--- a/ui/message_center/views/notification_view_md.cc
+++ b/ui/message_center/views/notification_view_md.cc
@@ -6,7 +6,9 @@
#include <stddef.h>
+#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
+#include "base/strings/utf_string_conversions.h"
#include "ui/base/cursor/cursor.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/canvas.h"
@@ -496,6 +498,7 @@ void NotificationViewMD::CreateOrUpdateProgressBarView(
if (notification.type() != NOTIFICATION_TYPE_PROGRESS) {
left_content_->RemoveChildView(progress_bar_view_);
progress_bar_view_ = nullptr;
+ header_row_->SetSummaryText(base::string16());
return;
}
@@ -511,6 +514,9 @@ void NotificationViewMD::CreateOrUpdateProgressBarView(
progress_bar_view_->SetValue(notification.progress() / 100.0);
progress_bar_view_->SetVisible(notification.items().empty());
+
+ header_row_->SetSummaryText(base::IntToString16(notification.progress()) +
yoshiki 2017/06/22 13:27:37 Could you make this a localized string?
+ base::ASCIIToUTF16("%"));
}
void NotificationViewMD::CreateOrUpdateListItemViews(

Powered by Google App Engine
This is Rietveld 408576698