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

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

Issue 711073002: Revert of Suspect that this is causing crash, reverting. Base URL: https://chromium.googlesource.com/chromium/src.git@2214
Patch Set: Created 6 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 | no next file » | 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 983febf83103e6eaca54ee0a24ad0a3166974037..b9b6f169bea411b0aca7ae2bec12c372c34ce2c8 100644
--- a/ui/message_center/views/message_center_view.cc
+++ b/ui/message_center/views/message_center_view.cc
@@ -54,6 +54,13 @@
const int kDefaultAnimationDurationMs = 120;
const int kDefaultFrameRateHz = 60;
+
+void SetViewHierarchyEnabled(views::View* view, bool enabled) {
+ for (int i = 0; i < view->child_count(); i++)
+ SetViewHierarchyEnabled(view->child_at(i), enabled);
+ view->SetEnabled(enabled);
+}
+
} // namespace
class NoNotificationMessageView : public views::View {
@@ -685,13 +692,13 @@
if (is_closing_)
return;
- scroller_->SetEnabled(false);
+ SetViewHierarchyEnabled(scroller_, false);
button_bar_->SetAllButtonsEnabled(false);
message_list_view_->ClearAllNotifications(scroller_->GetVisibleRect());
}
void MessageCenterView::OnAllNotificationsCleared() {
- scroller_->SetEnabled(true);
+ SetViewHierarchyEnabled(scroller_, true);
button_bar_->SetAllButtonsEnabled(true);
button_bar_->SetCloseAllButtonEnabled(false);
message_center_->RemoveAllVisibleNotifications(true); // Action by user.
@@ -863,12 +870,13 @@
next_focused_view = message_list_view_->child_at(index - 1);
if (next_focused_view) {
- if (view->IsCloseButtonFocused())
+ if (view->IsCloseButtonFocused()) {
// Safe cast since all views in MessageListView are MessageViews.
static_cast<MessageView*>(
next_focused_view)->RequestFocusOnCloseButton();
- else
+ } else {
next_focused_view->RequestFocus();
+ }
}
}
}
« 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