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

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

Issue 2120033002: 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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 508
509 message_center_tray_->HideMessageCenterBubble(); 509 message_center_tray_->HideMessageCenterBubble();
510 } 510 }
511 511
512 message_center::MessageCenter* WebNotificationTray::message_center() const { 512 message_center::MessageCenter* WebNotificationTray::message_center() const {
513 return message_center_tray_->message_center(); 513 return message_center_tray_->message_center();
514 } 514 }
515 515
516 bool WebNotificationTray::IsLoggedIn() const { 516 bool WebNotificationTray::IsLoggedIn() const {
517 WmShell* shell = WmShell::Get(); 517 WmShell* shell = WmShell::Get();
518 // TODO(jamescook): Should this also check LoginState::LOCKED? 518 LoginStatus status = shell->system_tray_delegate()->GetUserLoginStatus();
519 return shell->system_tray_delegate()->GetUserLoginStatus() != 519 return status != LoginStatus::NOT_LOGGED_IN &&
520 LoginStatus::NOT_LOGGED_IN && 520 status != LoginStatus::LOCKED &&
521 !shell->GetSessionStateDelegate()->IsInSecondaryLoginScreen(); 521 !shell->GetSessionStateDelegate()->IsInSecondaryLoginScreen();
522 } 522 }
523 523
524 // Methods for testing 524 // Methods for testing
525 525
526 bool WebNotificationTray::IsPopupVisible() const { 526 bool WebNotificationTray::IsPopupVisible() const {
527 return message_center_tray_->popups_visible(); 527 return message_center_tray_->popups_visible();
528 } 528 }
529 529
530 message_center::MessageCenterBubble* 530 message_center::MessageCenterBubble*
531 WebNotificationTray::GetMessageCenterBubbleForTest() { 531 WebNotificationTray::GetMessageCenterBubbleForTest() {
532 if (!message_center_bubble()) 532 if (!message_center_bubble())
533 return NULL; 533 return NULL;
534 return static_cast<message_center::MessageCenterBubble*>( 534 return static_cast<message_center::MessageCenterBubble*>(
535 message_center_bubble()->bubble()); 535 message_center_bubble()->bubble());
536 } 536 }
537 537
538 } // 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