| 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/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1166 // |focus_manager| can be NULL in tests. | 1166 // |focus_manager| can be NULL in tests. |
| 1167 if (focus_manager) | 1167 if (focus_manager) |
| 1168 focused_view = focus_manager->GetFocusedView(); | 1168 focused_view = focus_manager->GetFocusedView(); |
| 1169 | 1169 |
| 1170 // All the children of this view are owned by |this|. | 1170 // All the children of this view are owned by |this|. |
| 1171 scroller_->contents()->RemoveAllChildViews(/*delete_children=*/false); | 1171 scroller_->contents()->RemoveAllChildViews(/*delete_children=*/false); |
| 1172 scroller_->contents()->AddChildView( | 1172 scroller_->contents()->AddChildView( |
| 1173 no_message_views ? empty_list_view_.get() : message_list_view_.get()); | 1173 no_message_views ? empty_list_view_.get() : message_list_view_.get()); |
| 1174 | 1174 |
| 1175 button_bar_->SetCloseAllButtonEnabled(!no_message_views); | 1175 button_bar_->SetCloseAllButtonEnabled(!no_message_views); |
| 1176 scroller_->set_focusable(!no_message_views); | 1176 scroller_->SetFocusable(!no_message_views); |
| 1177 | 1177 |
| 1178 if (focus_manager && focused_view) | 1178 if (focus_manager && focused_view) |
| 1179 focus_manager->SetFocusedView(focused_view); | 1179 focus_manager->SetFocusedView(focused_view); |
| 1180 | 1180 |
| 1181 scroller_->InvalidateLayout(); | 1181 scroller_->InvalidateLayout(); |
| 1182 PreferredSizeChanged(); | 1182 PreferredSizeChanged(); |
| 1183 Layout(); | 1183 Layout(); |
| 1184 } | 1184 } |
| 1185 | 1185 |
| 1186 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { | 1186 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { |
| 1187 message_list_view_->AddNotificationAt(view, 0); | 1187 message_list_view_->AddNotificationAt(view, 0); |
| 1188 } | 1188 } |
| 1189 | 1189 |
| 1190 } // namespace message_center | 1190 } // namespace message_center |
| OLD | NEW |