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

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

Issue 2966693002: Move overflow indicator to notifiction header. (Closed)
Patch Set: Resolve review comments. 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
« no previous file with comments | « ui/message_center/views/notification_header_view.h ('k') | ui/message_center/views/notification_view_md.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/notification_header_view.cc
diff --git a/ui/message_center/views/notification_header_view.cc b/ui/message_center/views/notification_header_view.cc
index 7a4fa5d9d8a4b62f7af2b273010ba832839a332a..28f78a4219accff5211036c3504ba23c7eef91a9 100644
--- a/ui/message_center/views/notification_header_view.cc
+++ b/ui/message_center/views/notification_header_view.cc
@@ -147,12 +147,28 @@ void NotificationHeaderView::SetAppName(const base::string16& name) {
void NotificationHeaderView::SetProgress(int progress) {
summary_text_view_->SetText(l10n_util::GetStringFUTF16Int(
IDS_MESSAGE_CENTER_NOTIFICATION_PROGRESS_PERCENTAGE, progress));
- has_summary_text_ = true;
+ has_progress_ = true;
UpdateSummaryTextVisibility();
}
void NotificationHeaderView::ClearProgress() {
- has_summary_text_ = false;
+ has_progress_ = false;
+ UpdateSummaryTextVisibility();
+}
+
+void NotificationHeaderView::SetOverflowIndicator(int count) {
+ if (count > 0) {
+ summary_text_view_->SetText(l10n_util::GetStringFUTF16Int(
+ IDS_MESSAGE_CENTER_LIST_NOTIFICATION_HEADER_OVERFLOW_INDICATOR, count));
+ has_overflow_indicator_ = true;
+ } else {
+ has_overflow_indicator_ = false;
+ }
+ UpdateSummaryTextVisibility();
+}
+
+void NotificationHeaderView::ClearOverflowIndicator() {
+ has_overflow_indicator_ = false;
UpdateSummaryTextVisibility();
}
@@ -234,8 +250,9 @@ void NotificationHeaderView::UpdateControlButtonsVisibility() {
}
void NotificationHeaderView::UpdateSummaryTextVisibility() {
- summary_text_divider_->SetVisible(has_summary_text_);
- summary_text_view_->SetVisible(has_summary_text_);
+ const bool visible = has_progress_ || has_overflow_indicator_;
+ summary_text_divider_->SetVisible(visible);
+ summary_text_view_->SetVisible(visible);
Layout();
}
« no previous file with comments | « ui/message_center/views/notification_header_view.h ('k') | ui/message_center/views/notification_view_md.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698