| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/notifications/login_state_notification_blocker_chromeos
.h" | 5 #include "chrome/browser/notifications/login_state_notification_blocker_chromeos
.h" |
| 6 | 6 |
| 7 #include "ash/common/system/system_notifier.h" | 7 #include "ash/common/system/system_notifier.h" |
| 8 #include "ash/common/wm_shell.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/wm/window_properties.h" | 10 #include "ash/wm/window_properties.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 if (chromeos::LoginState::IsInitialized()) | 39 if (chromeos::LoginState::IsInitialized()) |
| 40 chromeos::LoginState::Get()->RemoveObserver(this); | 40 chromeos::LoginState::Get()->RemoveObserver(this); |
| 41 if (observing_) { | 41 if (observing_) { |
| 42 if (ash::WmShell::HasInstance()) | 42 if (ash::WmShell::HasInstance()) |
| 43 ash::WmShell::Get()->RemoveShellObserver(this); | 43 ash::WmShell::Get()->RemoveShellObserver(this); |
| 44 chromeos::UserAddingScreen::Get()->RemoveObserver(this); | 44 chromeos::UserAddingScreen::Get()->RemoveObserver(this); |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool LoginStateNotificationBlockerChromeOS::ShouldShowNotificationAsPopup( | 48 bool LoginStateNotificationBlockerChromeOS::ShouldShowNotificationAsPopup( |
| 49 const message_center::NotifierId& notifier_id) const { | 49 const message_center::Notification& notification) const { |
| 50 if (ash::system_notifier::ShouldAlwaysShowPopups(notifier_id)) | 50 if (ash::system_notifier::ShouldAlwaysShowPopups(notification.notifier_id())) |
| 51 return true; | 51 return true; |
| 52 | 52 |
| 53 if (locked_) | 53 if (locked_) |
| 54 return false; | 54 return false; |
| 55 | 55 |
| 56 if (chromeos::UserAddingScreen::Get()->IsRunning()) | 56 if (chromeos::UserAddingScreen::Get()->IsRunning()) |
| 57 return false; | 57 return false; |
| 58 | 58 |
| 59 if (chromeos::LoginState::IsInitialized()) | 59 if (chromeos::LoginState::IsInitialized()) |
| 60 return chromeos::LoginState::Get()->IsUserLoggedIn(); | 60 return chromeos::LoginState::Get()->IsUserLoggedIn(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 78 NotifyBlockingStateChanged(); | 78 NotifyBlockingStateChanged(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void LoginStateNotificationBlockerChromeOS::OnUserAddingStarted() { | 81 void LoginStateNotificationBlockerChromeOS::OnUserAddingStarted() { |
| 82 NotifyBlockingStateChanged(); | 82 NotifyBlockingStateChanged(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void LoginStateNotificationBlockerChromeOS::OnUserAddingFinished() { | 85 void LoginStateNotificationBlockerChromeOS::OnUserAddingFinished() { |
| 86 NotifyBlockingStateChanged(); | 86 NotifyBlockingStateChanged(); |
| 87 } | 87 } |
| OLD | NEW |