OLD | NEW |
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 "chromeos/login/login_state.h" | 5 #include "chromeos/login/login_state.h" |
6 | 6 |
7 #include "base/chromeos/chromeos_version.h" | |
8 #include "base/command_line.h" | 7 #include "base/command_line.h" |
9 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/sys_info.h" |
10 #include "chromeos/chromeos_switches.h" | 10 #include "chromeos/chromeos_switches.h" |
11 | 11 |
12 namespace chromeos { | 12 namespace chromeos { |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 // When running a Chrome OS build outside of a device (i.e. on a developer's | 16 // When running a Chrome OS build outside of a device (i.e. on a developer's |
17 // workstation) and not running as login-manager, pretend like we're always | 17 // workstation) and not running as login-manager, pretend like we're always |
18 // logged in. | 18 // logged in. |
19 bool AlwaysLoggedIn() { | 19 bool AlwaysLoggedIn() { |
20 return !base::chromeos::IsRunningOnChromeOS() && | 20 return !base::SysInfo::IsRunningOnChromeOS() && |
21 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginManager); | 21 !CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginManager); |
22 } | 22 } |
23 | 23 |
24 } // namespace | 24 } // namespace |
25 | 25 |
26 static LoginState* g_login_state = NULL; | 26 static LoginState* g_login_state = NULL; |
27 | 27 |
28 // static | 28 // static |
29 void LoginState::Initialize() { | 29 void LoginState::Initialize() { |
30 CHECK(!g_login_state); | 30 CHECK(!g_login_state); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 122 |
123 LoginState::~LoginState() { | 123 LoginState::~LoginState() { |
124 } | 124 } |
125 | 125 |
126 void LoginState::NotifyObservers() { | 126 void LoginState::NotifyObservers() { |
127 FOR_EACH_OBSERVER(LoginState::Observer, observer_list_, | 127 FOR_EACH_OBSERVER(LoginState::Observer, observer_list_, |
128 LoggedInStateChanged()); | 128 LoggedInStateChanged()); |
129 } | 129 } |
130 | 130 |
131 } // namespace chromeos | 131 } // namespace chromeos |
OLD | NEW |