OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 254 |
255 void MessageListView::ClearAllClosableNotifications( | 255 void MessageListView::ClearAllClosableNotifications( |
256 const gfx::Rect& visible_scroll_rect) { | 256 const gfx::Rect& visible_scroll_rect) { |
257 for (int i = 0; i < child_count(); ++i) { | 257 for (int i = 0; i < child_count(); ++i) { |
258 // Safe cast since all views in MessageListView are MessageViews. | 258 // Safe cast since all views in MessageListView are MessageViews. |
259 MessageView* child = (MessageView*)child_at(i); | 259 MessageView* child = (MessageView*)child_at(i); |
260 if (!child->visible()) | 260 if (!child->visible()) |
261 continue; | 261 continue; |
262 if (gfx::IntersectRects(child->bounds(), visible_scroll_rect).IsEmpty()) | 262 if (gfx::IntersectRects(child->bounds(), visible_scroll_rect).IsEmpty()) |
263 continue; | 263 continue; |
264 if (child->IsPinned()) | 264 if (child->pinned()) |
265 continue; | 265 continue; |
266 if (deleting_views_.find(child) != deleting_views_.end() || | 266 if (deleting_views_.find(child) != deleting_views_.end() || |
267 deleted_when_done_.find(child) != deleted_when_done_.end()) { | 267 deleted_when_done_.find(child) != deleted_when_done_.end()) { |
268 // We don't check clearing_all_views_ here, so this can lead to a | 268 // We don't check clearing_all_views_ here, so this can lead to a |
269 // notification being deleted twice. Even if we do check it, there is a | 269 // notification being deleted twice. Even if we do check it, there is a |
270 // problem similar to the problem in RemoveNotification(), it could be | 270 // problem similar to the problem in RemoveNotification(), it could be |
271 // currently in its animation before removal, and we could similarly | 271 // currently in its animation before removal, and we could similarly |
272 // delete it twice. This is a bug. | 272 // delete it twice. This is a bug. |
273 continue; | 273 continue; |
274 } | 274 } |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 base::TimeDelta::FromMilliseconds( | 566 base::TimeDelta::FromMilliseconds( |
567 kAnimateClearingNextNotificationDelayMS)); | 567 kAnimateClearingNextNotificationDelayMS)); |
568 } | 568 } |
569 } | 569 } |
570 | 570 |
571 void MessageListView::SetRepositionTargetForTest(const gfx::Rect& target_rect) { | 571 void MessageListView::SetRepositionTargetForTest(const gfx::Rect& target_rect) { |
572 SetRepositionTarget(target_rect); | 572 SetRepositionTarget(target_rect); |
573 } | 573 } |
574 | 574 |
575 } // namespace message_center | 575 } // namespace message_center |
OLD | NEW |