Chromium Code Reviews| Index: ui/message_center/views/message_center_view.cc |
| diff --git a/ui/message_center/views/message_center_view.cc b/ui/message_center/views/message_center_view.cc |
| index d54069488726a5fd10239c63399a24560a84410c..8faf42c082f22e33aa47aaed10aaad5f3e064ae7 100644 |
| --- a/ui/message_center/views/message_center_view.cc |
| +++ b/ui/message_center/views/message_center_view.cc |
| @@ -888,7 +888,9 @@ void MessageCenterView::OnNotificationAdded(const std::string& id) { |
| void MessageCenterView::OnNotificationRemoved(const std::string& id, |
| bool by_user) { |
| for (size_t i = 0; i < message_views_.size(); ++i) { |
| - if (message_views_[i]->notification_id() == id) { |
| + MessageView* message_view = message_views_[i]; |
| + if (message_view->GetType() == NOTIFICATION_VIEW && |
| + static_cast<NotificationView*>(message_view)->notification_id() == id) { |
|
dewittj
2013/11/19 01:44:04
static_cast? Any way to get around this?
|
| if (by_user) { |
| message_list_view_->SetRepositionTarget(message_views_[i]->bounds()); |
| // Moves the keyboard focus to the next notification if the removed |
| @@ -924,7 +926,11 @@ void MessageCenterView::OnNotificationUpdated(const std::string& id) { |
| notifications.begin(); |
| iter != notifications.end() && index < message_views_.size(); |
| ++iter, ++index) { |
| - DCHECK((*iter)->id() == message_views_[index]->notification_id()); |
| + // TODO(dimich): This fails if there are GROUP_VIEWs around, |
| + // they break the iter/index sync which is assumed here. |
| + DCHECK(message_views_[index]->GetType() != NOTIFICATION_VIEW || |
| + (*iter)->id() == static_cast<NotificationView*>( |
| + message_views_[index])->notification_id()); |
| if ((*iter)->id() == id) { |
| bool expanded = true; |
| if (IsExperimentalNotificationUIEnabled()) |