| OLD | NEW |
| 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 "chrome/browser/ui/ash/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 6 | 6 |
| 7 #include "ash/launcher/launcher_types.h" | 7 #include "ash/launcher/launcher_types.h" |
| 8 #include "ash/system/tray/system_tray_delegate.h" | 8 #include "ash/system/tray/system_tray_delegate.h" |
| 9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 return true; | 101 return true; |
| 102 } | 102 } |
| 103 | 103 |
| 104 return chromeos::UserManager::Get()->IsUserLoggedIn(); | 104 return chromeos::UserManager::Get()->IsUserLoggedIn(); |
| 105 #else | 105 #else |
| 106 return true; | 106 return true; |
| 107 #endif | 107 #endif |
| 108 } | 108 } |
| 109 | 109 |
| 110 // Returns true if we're logged in and browser has been started | 110 // Returns true if we're logged in and browser has been started |
| 111 bool ChromeShellDelegate::IsSessionStarted() { | 111 bool ChromeShellDelegate::IsSessionStarted() const { |
| 112 #if defined(OS_CHROMEOS) | 112 #if defined(OS_CHROMEOS) |
| 113 return chromeos::UserManager::Get()->IsSessionStarted(); | 113 return chromeos::UserManager::Get()->IsSessionStarted(); |
| 114 #else | 114 #else |
| 115 return true; | 115 return true; |
| 116 #endif | 116 #endif |
| 117 } | 117 } |
| 118 | 118 |
| 119 void ChromeShellDelegate::LockScreen() { | 119 void ChromeShellDelegate::LockScreen() { |
| 120 #if defined(OS_CHROMEOS) | 120 #if defined(OS_CHROMEOS) |
| 121 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession) && | 121 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession) && |
| 122 !chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) { | 122 !chromeos::KioskModeSettings::Get()->IsKioskModeEnabled()) { |
| 123 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> | 123 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> |
| 124 RequestLockScreen(); | 124 RequestLockScreen(); |
| 125 } | 125 } |
| 126 #endif | 126 #endif |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool ChromeShellDelegate::IsStatusAreaInitiallyVisible() const { |
| 130 #if defined(OS_CHROMEOS) |
| 131 // Login screen manages status area visibility by itself. |
| 132 return IsSessionStarted(); |
| 133 #else |
| 134 return true; |
| 135 #endif |
| 136 } |
| 137 |
| 129 void ChromeShellDelegate::UnlockScreen() { | 138 void ChromeShellDelegate::UnlockScreen() { |
| 130 // This is used only for testing thus far. | 139 // This is used only for testing thus far. |
| 131 NOTIMPLEMENTED(); | 140 NOTIMPLEMENTED(); |
| 132 } | 141 } |
| 133 | 142 |
| 134 bool ChromeShellDelegate::IsScreenLocked() const { | 143 bool ChromeShellDelegate::IsScreenLocked() const { |
| 135 #if defined(OS_CHROMEOS) | 144 #if defined(OS_CHROMEOS) |
| 136 if (!chromeos::ScreenLocker::default_screen_locker()) | 145 if (!chromeos::ScreenLocker::default_screen_locker()) |
| 137 return false; | 146 return false; |
| 138 return chromeos::ScreenLocker::default_screen_locker()->locked(); | 147 return chromeos::ScreenLocker::default_screen_locker()->locked(); |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 ash::Shell::GetInstance()->ShowLauncher(); | 418 ash::Shell::GetInstance()->ShowLauncher(); |
| 410 break; | 419 break; |
| 411 default: | 420 default: |
| 412 NOTREACHED() << "Unexpected notification " << type; | 421 NOTREACHED() << "Unexpected notification " << type; |
| 413 } | 422 } |
| 414 #else | 423 #else |
| 415 // MSVC++ warns about switch statements without any cases. | 424 // MSVC++ warns about switch statements without any cases. |
| 416 NOTREACHED() << "Unexpected notification " << type; | 425 NOTREACHED() << "Unexpected notification " << type; |
| 417 #endif | 426 #endif |
| 418 } | 427 } |
| OLD | NEW |