| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/sys_info.h" | 9 #include "base/sys_info.h" |
| 10 #include "chromeos/chromeos_switches.h" | 10 #include "chromeos/chromeos_switches.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 // static | 36 // static |
| 37 void LoginState::Shutdown() { | 37 void LoginState::Shutdown() { |
| 38 CHECK(g_login_state); | 38 CHECK(g_login_state); |
| 39 delete g_login_state; | 39 delete g_login_state; |
| 40 g_login_state = NULL; | 40 g_login_state = NULL; |
| 41 } | 41 } |
| 42 | 42 |
| 43 // static | 43 // static |
| 44 LoginState* LoginState::Get() { | 44 LoginState* LoginState::Get() { |
| 45 CHECK(g_login_state) << "LoginState::Get() called before Initialize()"; | 45 // LoginState::Get() called before Initialize() |
| 46 CHECK(g_login_state); |
| 46 return g_login_state; | 47 return g_login_state; |
| 47 } | 48 } |
| 48 | 49 |
| 49 // static | 50 // static |
| 50 bool LoginState::IsInitialized() { | 51 bool LoginState::IsInitialized() { |
| 51 return g_login_state; | 52 return g_login_state; |
| 52 } | 53 } |
| 53 | 54 |
| 54 void LoginState::AddObserver(Observer* observer) { | 55 void LoginState::AddObserver(Observer* observer) { |
| 55 observer_list_.AddObserver(observer); | 56 observer_list_.AddObserver(observer); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 132 |
| 132 LoginState::~LoginState() { | 133 LoginState::~LoginState() { |
| 133 } | 134 } |
| 134 | 135 |
| 135 void LoginState::NotifyObservers() { | 136 void LoginState::NotifyObservers() { |
| 136 for (auto& observer : observer_list_) | 137 for (auto& observer : observer_list_) |
| 137 observer.LoggedInStateChanged(); | 138 observer.LoggedInStateChanged(); |
| 138 } | 139 } |
| 139 | 140 |
| 140 } // namespace chromeos | 141 } // namespace chromeos |
| OLD | NEW |