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 <map> | 7 #include <map> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 1.0f, views::GridLayout::USE_PREF, 0, 0); | 248 1.0f, views::GridLayout::USE_PREF, 0, 0); |
249 column->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, | 249 column->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, |
250 0, views::GridLayout::USE_PREF, 0, 0); | 250 0, views::GridLayout::USE_PREF, 0, 0); |
251 layout->StartRow(0, 0); | 251 layout->StartRow(0, 0); |
252 layout->AddView(notification_label); | 252 layout->AddView(notification_label); |
253 layout->AddView(button_container); | 253 layout->AddView(button_container); |
254 } | 254 } |
255 | 255 |
256 // Overridden from views::View: | 256 // Overridden from views::View: |
257 void RichMessageCenterButtonBar::ChildVisibilityChanged(views::View* child) { | 257 void RichMessageCenterButtonBar::ChildVisibilityChanged(views::View* child) { |
258 InvalidateLayout(); | 258 Layout(); |
259 } | 259 } |
260 | 260 |
261 // Overridden from views::ButtonListener: | 261 // Overridden from views::ButtonListener: |
262 void RichMessageCenterButtonBar::ButtonPressed(views::Button* sender, | 262 void RichMessageCenterButtonBar::ButtonPressed(views::Button* sender, |
263 const ui::Event& event) { | 263 const ui::Event& event) { |
264 if (sender == close_all_button()) { | 264 if (sender == close_all_button()) { |
265 message_center()->RemoveAllNotifications(true); // Action by user. | 265 message_center()->RemoveAllNotifications(true); // Action by user. |
266 } else if (sender == settings_button_) { | 266 } else if (sender == settings_button_) { |
267 message_center()->ShowNotificationSettingsDialog( | 267 message_center()->ShowNotificationSettingsDialog( |
268 GetWidget()->GetNativeView()); | 268 GetWidget()->GetNativeView()); |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 void MessageCenterView::NotificationsChanged() { | 909 void MessageCenterView::NotificationsChanged() { |
910 if (!message_views_.empty()) { | 910 if (!message_views_.empty()) { |
911 no_notifications_message_view_->SetVisible(false); | 911 no_notifications_message_view_->SetVisible(false); |
912 button_bar_->SetCloseAllVisible(true); | 912 button_bar_->SetCloseAllVisible(true); |
913 scroller_->set_focusable(true); | 913 scroller_->set_focusable(true); |
914 } else { | 914 } else { |
915 no_notifications_message_view_->SetVisible(true); | 915 no_notifications_message_view_->SetVisible(true); |
916 button_bar_->SetCloseAllVisible(false); | 916 button_bar_->SetCloseAllVisible(false); |
917 scroller_->set_focusable(false); | 917 scroller_->set_focusable(false); |
918 } | 918 } |
919 scroller_->InvalidateLayout(); | |
920 PreferredSizeChanged(); | 919 PreferredSizeChanged(); |
921 Layout(); | 920 scroller_->Layout(); |
922 } | 921 } |
923 | 922 |
924 void MessageCenterView::SetNotificationViewForTest(views::View* view) { | 923 void MessageCenterView::SetNotificationViewForTest(views::View* view) { |
925 message_list_view_->AddNotificationAt(view, 0); | 924 message_list_view_->AddNotificationAt(view, 0); |
926 } | 925 } |
927 | 926 |
928 } // namespace message_center | 927 } // namespace message_center |
OLD | NEW |