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

Unified Diff: ui/message_center/views/message_center_view.cc

Issue 75133006: Move knowledge about MessageCenter out of MessageView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win build break Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/message_center/views/message_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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())
« no previous file with comments | « no previous file | ui/message_center/views/message_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698