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

Side by Side Diff: ash/common/system/web_notification/web_notification_tray.cc

Issue 2151613002: Revert "Hide web notification tray when LoginStatus is locked" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/common/system/web_notification/web_notification_tray.h" 5 #include "ash/common/system/web_notification/web_notification_tray.h"
6 6
7 #include "ash/common/ash_switches.h" 7 #include "ash/common/ash_switches.h"
8 #include "ash/common/material_design/material_design_controller.h" 8 #include "ash/common/material_design/material_design_controller.h"
9 #include "ash/common/session/session_state_delegate.h" 9 #include "ash/common/session/session_state_delegate.h"
10 #include "ash/common/shelf/shelf_constants.h" 10 #include "ash/common/shelf/shelf_constants.h"
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 509
510 message_center_tray_->HideMessageCenterBubble(); 510 message_center_tray_->HideMessageCenterBubble();
511 } 511 }
512 512
513 message_center::MessageCenter* WebNotificationTray::message_center() const { 513 message_center::MessageCenter* WebNotificationTray::message_center() const {
514 return message_center_tray_->message_center(); 514 return message_center_tray_->message_center();
515 } 515 }
516 516
517 bool WebNotificationTray::IsLoggedIn() const { 517 bool WebNotificationTray::IsLoggedIn() const {
518 WmShell* shell = WmShell::Get(); 518 WmShell* shell = WmShell::Get();
519 LoginStatus status = shell->system_tray_delegate()->GetUserLoginStatus(); 519 return shell->system_tray_delegate()->GetUserLoginStatus() !=
520 return status != LoginStatus::NOT_LOGGED_IN && 520 LoginStatus::NOT_LOGGED_IN &&
521 status != LoginStatus::LOCKED &&
522 !shell->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); 521 !shell->GetSessionStateDelegate()->IsInSecondaryLoginScreen();
523 } 522 }
524 523
525 // Methods for testing 524 // Methods for testing
526 525
527 bool WebNotificationTray::IsPopupVisible() const { 526 bool WebNotificationTray::IsPopupVisible() const {
528 return message_center_tray_->popups_visible(); 527 return message_center_tray_->popups_visible();
529 } 528 }
530 529
531 message_center::MessageCenterBubble* 530 message_center::MessageCenterBubble*
532 WebNotificationTray::GetMessageCenterBubbleForTest() { 531 WebNotificationTray::GetMessageCenterBubbleForTest() {
533 if (!message_center_bubble()) 532 if (!message_center_bubble())
534 return NULL; 533 return NULL;
535 return static_cast<message_center::MessageCenterBubble*>( 534 return static_cast<message_center::MessageCenterBubble*>(
536 message_center_bubble()->bubble()); 535 message_center_bubble()->bubble());
537 } 536 }
538 537
539 } // namespace ash 538 } // namespace ash
OLDNEW
« 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