| 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 243 |
| 244 // static | 244 // static |
| 245 UserManager* UserManager::Get() { | 245 UserManager* UserManager::Get() { |
| 246 // Not thread-safe. | 246 // Not thread-safe. |
| 247 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 247 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 248 return &g_user_manager.Get(); | 248 return &g_user_manager.Get(); |
| 249 } | 249 } |
| 250 | 250 |
| 251 // static | 251 // static |
| 252 void UserManager::RegisterPrefs(PrefService* local_state) { | 252 void UserManager::RegisterPrefs(PrefService* local_state) { |
| 253 local_state->RegisterListPref(kLoggedInUsers); | 253 local_state->RegisterListPref(kLoggedInUsers, false /* don't sync pref */); |
| 254 local_state->RegisterDictionaryPref(kUserImages); | 254 local_state->RegisterDictionaryPref(kUserImages, |
| 255 false /* don't sync pref */); |
| 255 } | 256 } |
| 256 | 257 |
| 257 std::vector<UserManager::User> UserManager::GetUsers() const { | 258 std::vector<UserManager::User> UserManager::GetUsers() const { |
| 258 std::vector<User> users; | 259 std::vector<User> users; |
| 259 if (!g_browser_process) | 260 if (!g_browser_process) |
| 260 return users; | 261 return users; |
| 261 | 262 |
| 262 PrefService* local_state = g_browser_process->local_state(); | 263 PrefService* local_state = g_browser_process->local_state(); |
| 263 const ListValue* prefs_users = local_state->GetList(kLoggedInUsers); | 264 const ListValue* prefs_users = local_state->GetList(kLoggedInUsers); |
| 264 const DictionaryValue* prefs_images = local_state->GetDictionary(kUserImages); | 265 const DictionaryValue* prefs_images = local_state->GetDictionary(kUserImages); |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 base::AutoLock lk(current_user_is_owner_lock_); | 612 base::AutoLock lk(current_user_is_owner_lock_); |
| 612 return current_user_is_owner_; | 613 return current_user_is_owner_; |
| 613 } | 614 } |
| 614 | 615 |
| 615 void UserManager::set_current_user_is_owner(bool current_user_is_owner) { | 616 void UserManager::set_current_user_is_owner(bool current_user_is_owner) { |
| 616 base::AutoLock lk(current_user_is_owner_lock_); | 617 base::AutoLock lk(current_user_is_owner_lock_); |
| 617 current_user_is_owner_ = current_user_is_owner; | 618 current_user_is_owner_ = current_user_is_owner; |
| 618 } | 619 } |
| 619 | 620 |
| 620 } // namespace chromeos | 621 } // namespace chromeos |
| OLD | NEW |