| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/login/user_manager.h" | 5 #include "chrome/browser/chromeos/login/user_manager.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 229 |
| 230 // static | 230 // static |
| 231 UserManager* UserManager::Get() { | 231 UserManager* UserManager::Get() { |
| 232 // Not thread-safe. | 232 // Not thread-safe. |
| 233 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 233 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 234 return &g_user_manager.Get(); | 234 return &g_user_manager.Get(); |
| 235 } | 235 } |
| 236 | 236 |
| 237 // static | 237 // static |
| 238 void UserManager::RegisterPrefs(PrefService* local_state) { | 238 void UserManager::RegisterPrefs(PrefService* local_state) { |
| 239 local_state->RegisterListPref(kLoggedInUsers); | 239 local_state->RegisterListPref(kLoggedInUsers, PrefService::UNSYNCABLE_PREF); |
| 240 local_state->RegisterDictionaryPref(kUserImages); | 240 local_state->RegisterDictionaryPref(kUserImages, |
| 241 PrefService::UNSYNCABLE_PREF); |
| 241 } | 242 } |
| 242 | 243 |
| 243 std::vector<UserManager::User> UserManager::GetUsers() const { | 244 std::vector<UserManager::User> UserManager::GetUsers() const { |
| 244 std::vector<User> users; | 245 std::vector<User> users; |
| 245 if (!g_browser_process) | 246 if (!g_browser_process) |
| 246 return users; | 247 return users; |
| 247 | 248 |
| 248 PrefService* local_state = g_browser_process->local_state(); | 249 PrefService* local_state = g_browser_process->local_state(); |
| 249 const ListValue* prefs_users = local_state->GetList(kLoggedInUsers); | 250 const ListValue* prefs_users = local_state->GetList(kLoggedInUsers); |
| 250 const DictionaryValue* prefs_images = local_state->GetDictionary(kUserImages); | 251 const DictionaryValue* prefs_images = local_state->GetDictionary(kUserImages); |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 base::AutoLock lk(current_user_is_owner_lock_); | 619 base::AutoLock lk(current_user_is_owner_lock_); |
| 619 return current_user_is_owner_; | 620 return current_user_is_owner_; |
| 620 } | 621 } |
| 621 | 622 |
| 622 void UserManager::set_current_user_is_owner(bool current_user_is_owner) { | 623 void UserManager::set_current_user_is_owner(bool current_user_is_owner) { |
| 623 base::AutoLock lk(current_user_is_owner_lock_); | 624 base::AutoLock lk(current_user_is_owner_lock_); |
| 624 current_user_is_owner_ = current_user_is_owner; | 625 current_user_is_owner_ = current_user_is_owner; |
| 625 } | 626 } |
| 626 | 627 |
| 627 } // namespace chromeos | 628 } // namespace chromeos |
| OLD | NEW |