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

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

Issue 2834773002: Hide popup custom notifications on non-primary displays (Closed)
Patch Set: Rewrote comment Created 3 years, 8 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/message_popup_collection.cc
diff --git a/ui/message_center/views/message_popup_collection.cc b/ui/message_center/views/message_popup_collection.cc
index 0a2afc4caa5640e5fbf5418c1365456bc70a6c47..396721d56fde81c6802b69266562647406225dbc 100644
--- a/ui/message_center/views/message_popup_collection.cc
+++ b/ui/message_center/views/message_popup_collection.cc
@@ -173,6 +173,10 @@ void MessagePopupCollection::UpdateWidgets() {
bool top_down = alignment_delegate_->IsTopDown();
int base = GetBaseLine(toasts_.empty() ? NULL : toasts_.back());
+#if defined(OS_CHROMEOS)
+ bool is_primary_display =
+ alignment_delegate_->IsPrimaryDisplayForNotification();
+#endif
// Iterate in the reverse order to keep the oldest toasts on screen. Newer
// items may be ignored if there are no room to place them.
@@ -181,6 +185,16 @@ void MessagePopupCollection::UpdateWidgets() {
if (FindToast((*iter)->id()))
continue;
+#if defined(OS_CHROMEOS)
+ // Disables popup of custom notification on non-primary displays, since
+ // currently custom notification supports only on one display at the same
+ // time.
+ // TODO(yoshiki): Support custom popup notification on multiple display
+ // (crbug.com/715370).
+ if (!is_primary_display && (*iter)->type() == NOTIFICATION_TYPE_CUSTOM)
+ continue;
+#endif
+
MessageView* view;
// Create top-level notification.
#if defined(OS_CHROMEOS)
« no previous file with comments | « ui/message_center/views/desktop_popup_alignment_delegate.cc ('k') | ui/message_center/views/popup_alignment_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698