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

Side by Side Diff: ui/message_center/views/message_center_view.cc

Issue 2622603003: Hide icons in message center on lock screen (Closed)
Patch Set: Mentioned about height parameter Created 3 years, 10 months 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 unified diff | Download patch
OLDNEW
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
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 if (!is_locked_)
628 EnableCloseAllIfAppropriate();
629 }
630
631 void MessageCenterView::EnableCloseAllIfAppropriate() {
627 if (mode_ == Mode::NOTIFICATIONS) { 632 if (mode_ == Mode::NOTIFICATIONS) {
628 bool no_closable_views = true; 633 bool no_closable_views = true;
629 for (const auto& view : notification_views_) { 634 for (const auto& view : notification_views_) {
630 if (!view.second->IsPinned()) { 635 if (!view.second->IsPinned()) {
631 no_closable_views = false; 636 no_closable_views = false;
632 break; 637 break;
633 } 638 }
634 } 639 }
635 button_bar_->SetCloseAllButtonEnabled(!no_closable_views); 640 button_bar_->SetCloseAllButtonEnabled(!no_closable_views);
636 } else { 641 } else {
637 // Disable the close-all button since no notification is visible. 642 // Disable the close-all button since no notification is visible.
638 button_bar_->SetCloseAllButtonEnabled(false); 643 button_bar_->SetCloseAllButtonEnabled(false);
639 } 644 }
640 } 645 }
641 646
642 void MessageCenterView::SetNotificationViewForTest(MessageView* view) { 647 void MessageCenterView::SetNotificationViewForTest(MessageView* view) {
643 message_list_view_->AddNotificationAt(view, 0); 648 message_list_view_->AddNotificationAt(view, 0);
644 } 649 }
645 650
646 } // namespace message_center 651 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/views/message_center_view.h ('k') | ui/message_center/views/message_center_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698