| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/message_center/views/message_center_view.h" | 5 #include "ui/message_center/views/message_center_view.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "grit/ui_strings.h" | 10 #include "grit/ui_strings.h" |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 } | 492 } |
| 493 | 493 |
| 494 void RichMessageListView::RemoveNotificationAt(int i) { | 494 void RichMessageListView::RemoveNotificationAt(int i) { |
| 495 views::View* child = child_at(GetActualIndex(i)); | 495 views::View* child = child_at(GetActualIndex(i)); |
| 496 if (GetContentsBounds().IsEmpty()) { | 496 if (GetContentsBounds().IsEmpty()) { |
| 497 delete child; | 497 delete child; |
| 498 } else { | 498 } else { |
| 499 if (child->layer()) { | 499 if (child->layer()) { |
| 500 deleting_views_.insert(child); | 500 deleting_views_.insert(child); |
| 501 } else { | 501 } else { |
| 502 animator_->StopAnimatingView(child); | 502 if (animator_.get()) |
| 503 animator_->StopAnimatingView(child); |
| 503 delete child; | 504 delete child; |
| 504 } | 505 } |
| 505 DoUpdateIfPossible(); | 506 DoUpdateIfPossible(); |
| 506 } | 507 } |
| 507 } | 508 } |
| 508 | 509 |
| 509 void RichMessageListView::UpdateNotificationAt(views::View* view, int i) { | 510 void RichMessageListView::UpdateNotificationAt(views::View* view, int i) { |
| 510 views::View* child = child_at(GetActualIndex(i)); | 511 views::View* child = child_at(GetActualIndex(i)); |
| 511 if (animator_.get()) | 512 if (animator_.get()) |
| 512 animator_->StopAnimatingView(child); | 513 animator_->StopAnimatingView(child); |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 PreferredSizeChanged(); | 872 PreferredSizeChanged(); |
| 872 Layout(); | 873 Layout(); |
| 873 } | 874 } |
| 874 | 875 |
| 875 void MessageCenterView::SetNotificationViewForTest(views::View* view) { | 876 void MessageCenterView::SetNotificationViewForTest(views::View* view) { |
| 876 message_list_view_->RemoveAllChildViews(true); | 877 message_list_view_->RemoveAllChildViews(true); |
| 877 message_list_view_->AddNotificationAt(view, 0); | 878 message_list_view_->AddNotificationAt(view, 0); |
| 878 } | 879 } |
| 879 | 880 |
| 880 } // namespace message_center | 881 } // namespace message_center |
| OLD | NEW |