Chromium Code Reviews| 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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 614 | 614 |
| 615 void MessageCenterView::UpdateButtonBarStatus() { | 615 void MessageCenterView::UpdateButtonBarStatus() { |
| 616 // Disables all buttons during animation of cleaning of all notifications. | 616 // Disables all buttons during animation of cleaning of all notifications. |
| 617 if (is_clearing_) { | 617 if (is_clearing_) { |
| 618 button_bar_->SetSettingsAndQuietModeButtonsEnabled(false); | 618 button_bar_->SetSettingsAndQuietModeButtonsEnabled(false); |
| 619 button_bar_->SetCloseAllButtonEnabled(false); | 619 button_bar_->SetCloseAllButtonEnabled(false); |
| 620 return; | 620 return; |
| 621 } | 621 } |
| 622 | 622 |
| 623 button_bar_->SetBackArrowVisible(mode_ == Mode::SETTINGS); | 623 button_bar_->SetBackArrowVisible(mode_ == Mode::SETTINGS); |
| 624 button_bar_->SetSettingsAndQuietModeButtonsEnabled(!is_locked_); | 624 button_bar_->SetButtonsVisible(!is_locked_); |
| 625 button_bar_->SetTitle(GetButtonBarTitle()); | 625 button_bar_->SetTitle(GetButtonBarTitle()); |
| 626 | 626 |
| 627 // Skips the followings if the screen is locked and the buttons are hidden. | |
| 628 if (is_locked_) | |
|
dewittj
2017/01/12 18:29:57
nit: This seems somewwhat fragile to future update
| |
| 629 return; | |
| 630 | |
| 627 if (mode_ == Mode::NOTIFICATIONS) { | 631 if (mode_ == Mode::NOTIFICATIONS) { |
| 628 bool no_closable_views = true; | 632 bool no_closable_views = true; |
| 629 for (const auto& view : notification_views_) { | 633 for (const auto& view : notification_views_) { |
| 630 if (!view.second->IsPinned()) { | 634 if (!view.second->IsPinned()) { |
| 631 no_closable_views = false; | 635 no_closable_views = false; |
| 632 break; | 636 break; |
| 633 } | 637 } |
| 634 } | 638 } |
| 635 button_bar_->SetCloseAllButtonEnabled(!no_closable_views); | 639 button_bar_->SetCloseAllButtonEnabled(!no_closable_views); |
| 636 } else { | 640 } else { |
| 637 // Disable the close-all button since no notification is visible. | 641 // Disable the close-all button since no notification is visible. |
| 638 button_bar_->SetCloseAllButtonEnabled(false); | 642 button_bar_->SetCloseAllButtonEnabled(false); |
| 639 } | 643 } |
| 640 } | 644 } |
| 641 | 645 |
| 642 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { | 646 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { |
| 643 message_list_view_->AddNotificationAt(view, 0); | 647 message_list_view_->AddNotificationAt(view, 0); |
| 644 } | 648 } |
| 645 | 649 |
| 646 } // namespace message_center | 650 } // namespace message_center |
| OLD | NEW |