| 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 <list> | 7 #include <list> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 message_list_view_->ResetRepositionSession(); | 390 message_list_view_->ResetRepositionSession(); |
| 391 | 391 |
| 392 // TODO(dimich): add MessageCenter::GetVisibleNotificationById(id) | 392 // TODO(dimich): add MessageCenter::GetVisibleNotificationById(id) |
| 393 MessageView* view = view_iter->second; | 393 MessageView* view = view_iter->second; |
| 394 const NotificationList::Notifications& notifications = | 394 const NotificationList::Notifications& notifications = |
| 395 message_center_->GetVisibleNotifications(); | 395 message_center_->GetVisibleNotifications(); |
| 396 for (NotificationList::Notifications::const_iterator iter = | 396 for (NotificationList::Notifications::const_iterator iter = |
| 397 notifications.begin(); iter != notifications.end(); ++iter) { | 397 notifications.begin(); iter != notifications.end(); ++iter) { |
| 398 if ((*iter)->id() == id) { | 398 if ((*iter)->id() == id) { |
| 399 int old_width = view->width(); | 399 int old_width = view->width(); |
| 400 int old_height = view->GetHeightForWidth(old_width); | 400 int old_height = view->height(); |
| 401 message_list_view_->UpdateNotification(view, **iter); | 401 message_list_view_->UpdateNotification(view, **iter); |
| 402 if (view->GetHeightForWidth(old_width) != old_height) | 402 if (view->GetHeightForWidth(old_width) != old_height) |
| 403 Update(true /* animate */); | 403 Update(true /* animate */); |
| 404 break; | 404 break; |
| 405 } | 405 } |
| 406 } | 406 } |
| 407 } | 407 } |
| 408 | 408 |
| 409 void MessageCenterView::OnLockedStateChanged(bool locked) { | 409 void MessageCenterView::OnLockedStateChanged(bool locked) { |
| 410 is_locked_ = locked; | 410 is_locked_ = locked; |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 // Disable the close-all button since no notification is visible. | 623 // Disable the close-all button since no notification is visible. |
| 624 button_bar_->SetCloseAllButtonEnabled(false); | 624 button_bar_->SetCloseAllButtonEnabled(false); |
| 625 } | 625 } |
| 626 } | 626 } |
| 627 | 627 |
| 628 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { | 628 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { |
| 629 message_list_view_->AddNotificationAt(view, 0); | 629 message_list_view_->AddNotificationAt(view, 0); |
| 630 } | 630 } |
| 631 | 631 |
| 632 } // namespace message_center | 632 } // namespace message_center |
| OLD | NEW |