| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/synchronization/lock.h" | 7 #include "base/synchronization/lock.h" |
| 8 #include "chrome/browser/chromeos/login/user_manager_impl.h" | 8 #include "chrome/browser/chromeos/login/user_manager_impl.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| 11 | 11 |
| 12 namespace chromeos { | 12 namespace chromeos { |
| 13 | 13 |
| 14 // static | 14 // static |
| 15 const char UserManager::kLoggedInUsers[] = "LoggedInUsers"; | 15 const char UserManager::kLoggedInUsers[] = "LoggedInUsers"; |
| 16 const char UserManager::kUserWallpapers[] = "UserWallpapers"; |
| 16 const char UserManager::kUserImages[] = "UserImages"; | 17 const char UserManager::kUserImages[] = "UserImages"; |
| 17 const char UserManager::kUserDisplayEmail[] = "UserDisplayEmail"; | 18 const char UserManager::kUserDisplayEmail[] = "UserDisplayEmail"; |
| 18 const char UserManager::kUserOAuthTokenStatus[] = "OAuthTokenStatus"; | 19 const char UserManager::kUserOAuthTokenStatus[] = "OAuthTokenStatus"; |
| 19 | 20 |
| 20 // Class that is holds pointer to UserManager instance. | 21 // Class that is holds pointer to UserManager instance. |
| 21 // One could set UserManager mock instance through it (see UserManager::Set). | 22 // One could set UserManager mock instance through it (see UserManager::Set). |
| 22 class UserManagerImplWrapper { | 23 class UserManagerImplWrapper { |
| 23 public: | 24 public: |
| 24 static UserManagerImplWrapper* GetInstance() { | 25 static UserManagerImplWrapper* GetInstance() { |
| 25 return Singleton<UserManagerImplWrapper>::get(); | 26 return Singleton<UserManagerImplWrapper>::get(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } | 63 } |
| 63 | 64 |
| 64 // static | 65 // static |
| 65 void UserManager::Set(UserManager* mock) { | 66 void UserManager::Set(UserManager* mock) { |
| 66 UserManagerImplWrapper::GetInstance()->reset(mock); | 67 UserManagerImplWrapper::GetInstance()->reset(mock); |
| 67 } | 68 } |
| 68 | 69 |
| 69 // static | 70 // static |
| 70 void UserManager::RegisterPrefs(PrefService* local_state) { | 71 void UserManager::RegisterPrefs(PrefService* local_state) { |
| 71 local_state->RegisterListPref(kLoggedInUsers, PrefService::UNSYNCABLE_PREF); | 72 local_state->RegisterListPref(kLoggedInUsers, PrefService::UNSYNCABLE_PREF); |
| 73 local_state->RegisterDictionaryPref(kUserWallpapers, |
| 74 PrefService::UNSYNCABLE_PREF); |
| 72 local_state->RegisterDictionaryPref(kUserImages, | 75 local_state->RegisterDictionaryPref(kUserImages, |
| 73 PrefService::UNSYNCABLE_PREF); | 76 PrefService::UNSYNCABLE_PREF); |
| 74 local_state->RegisterDictionaryPref(kUserOAuthTokenStatus, | 77 local_state->RegisterDictionaryPref(kUserOAuthTokenStatus, |
| 75 PrefService::UNSYNCABLE_PREF); | 78 PrefService::UNSYNCABLE_PREF); |
| 76 local_state->RegisterDictionaryPref(kUserDisplayEmail, | 79 local_state->RegisterDictionaryPref(kUserDisplayEmail, |
| 77 PrefService::UNSYNCABLE_PREF); | 80 PrefService::UNSYNCABLE_PREF); |
| 78 } | 81 } |
| 79 | 82 |
| 80 UserManager::~UserManager() { | 83 UserManager::~UserManager() { |
| 81 } | 84 } |
| 82 | 85 |
| 83 } // namespace chromeos | 86 } // namespace chromeos |
| OLD | NEW |