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

Side by Side Diff: ui/message_center/views/message_center_view.cc

Issue 15019019: Merge 199426 "Fixes a crash bug of calling animator without check." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1500/src/
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698