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

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

Issue 1645843003: Implement Non-Closable Notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary property. Created 4 years, 10 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/message_list_view.h ('k') | ui/message_center/views/message_popup_collection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/message_list_view.cc
diff --git a/ui/message_center/views/message_list_view.cc b/ui/message_center/views/message_list_view.cc
index 95933305a0e65f78018174b933611bac208969f6..70879983b38b6df25c9c8484533656af6b95b4e1 100644
--- a/ui/message_center/views/message_list_view.cc
+++ b/ui/message_center/views/message_list_view.cc
@@ -191,17 +191,24 @@ void MessageListView::ResetRepositionSession() {
fixed_height_ = 0;
}
-void MessageListView::ClearAllNotifications(
+void MessageListView::ClearAllClosableNotifications(
const gfx::Rect& visible_scroll_rect) {
for (int i = 0; i < child_count(); ++i) {
- views::View* child = child_at(i);
+ // Safe cast since all views in MessageListView are MessageViews.
+ MessageView* child = (MessageView*)child_at(i);
if (!child->visible())
continue;
if (gfx::IntersectRects(child->bounds(), visible_scroll_rect).IsEmpty())
continue;
+ if (child->IsPinned())
+ continue;
clearing_all_views_.push_back(child);
}
- DoUpdateIfPossible();
+ if (clearing_all_views_.empty()) {
+ message_center_view()->OnAllNotificationsCleared();
+ } else {
+ DoUpdateIfPossible();
+ }
}
void MessageListView::OnBoundsAnimatorProgressed(
« no previous file with comments | « ui/message_center/views/message_list_view.h ('k') | ui/message_center/views/message_popup_collection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698