| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 LoggedInState state, | 61 LoggedInState state, |
| 62 LoggedInUserType type, | 62 LoggedInUserType type, |
| 63 const std::string& primary_user_hash) { | 63 const std::string& primary_user_hash) { |
| 64 DCHECK(type != LOGGED_IN_USER_NONE); | 64 DCHECK(type != LOGGED_IN_USER_NONE); |
| 65 primary_user_hash_ = primary_user_hash; | 65 primary_user_hash_ = primary_user_hash; |
| 66 VLOG(1) << "LoggedInStateUser: " << primary_user_hash; | 66 VLOG(1) << "LoggedInStateUser: " << primary_user_hash; |
| 67 SetLoggedInState(state, type); | 67 SetLoggedInState(state, type); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void LoginState::SetLoggedInState(LoggedInState state, LoggedInUserType type) { | 70 void LoginState::SetLoggedInState(LoggedInState state, LoggedInUserType type) { |
| 71 CHECK_NE(LOGGED_IN_USER_RETAIL_MODE, type); | |
| 72 if (state == logged_in_state_ && type == logged_in_user_type_) | 71 if (state == logged_in_state_ && type == logged_in_user_type_) |
| 73 return; | 72 return; |
| 74 VLOG(1) << "LoggedInState: " << state << " UserType: " << type; | 73 VLOG(1) << "LoggedInState: " << state << " UserType: " << type; |
| 75 logged_in_state_ = state; | 74 logged_in_state_ = state; |
| 76 logged_in_user_type_ = type; | 75 logged_in_user_type_ = type; |
| 77 NotifyObservers(); | 76 NotifyObservers(); |
| 78 } | 77 } |
| 79 | 78 |
| 80 LoginState::LoggedInUserType LoginState::GetLoggedInUserType() const { | 79 LoginState::LoggedInUserType LoginState::GetLoggedInUserType() const { |
| 81 return logged_in_user_type_; | 80 return logged_in_user_type_; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 129 |
| 131 LoginState::~LoginState() { | 130 LoginState::~LoginState() { |
| 132 } | 131 } |
| 133 | 132 |
| 134 void LoginState::NotifyObservers() { | 133 void LoginState::NotifyObservers() { |
| 135 FOR_EACH_OBSERVER(LoginState::Observer, observer_list_, | 134 FOR_EACH_OBSERVER(LoginState::Observer, observer_list_, |
| 136 LoggedInStateChanged()); | 135 LoggedInStateChanged()); |
| 137 } | 136 } |
| 138 | 137 |
| 139 } // namespace chromeos | 138 } // namespace chromeos |
| OLD | NEW |