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

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: Addressed the comments 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
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..d2e95909df2e0a4a5ba073b550ce098e40f3fa9e 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(
dewittj 2016/02/08 18:02:34 How does the clear-all animation look when there a
yoshiki 2016/02/09 23:42:25 Android dosen't have any animation for non-closabl
dewittj 2016/02/10 00:03:15 Does the ChromeOS notification center close itself
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->IsClosable())
+ continue;
clearing_all_views_.push_back(child);
}
- DoUpdateIfPossible();
+ if (clearing_all_views_.empty()) {
+ message_center_view()->OnAllNotificationsCleared();
+ } else {
+ DoUpdateIfPossible();
+ }
}
void MessageListView::OnBoundsAnimatorProgressed(

Powered by Google App Engine
This is Rietveld 408576698