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/password_manager/password_store_factory.h" | 5 #include "chrome/browser/password_manager/password_store_factory.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/password_manager/login_database.h" | 10 #include "chrome/browser/password_manager/login_database.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 delete login_db; | 188 delete login_db; |
189 | 189 |
190 if (!ps || !ps->Init()) { | 190 if (!ps || !ps->Init()) { |
191 NOTREACHED() << "Could not initialize password manager."; | 191 NOTREACHED() << "Could not initialize password manager."; |
192 return NULL; | 192 return NULL; |
193 } | 193 } |
194 | 194 |
195 return ps; | 195 return ps; |
196 } | 196 } |
197 | 197 |
198 void PasswordStoreFactory::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 198 void PasswordStoreFactory::RegisterUserPrefs( |
| 199 user_prefs::PrefRegistrySyncable* registry) { |
199 #if !defined(OS_CHROMEOS) && defined(USE_X11) | 200 #if !defined(OS_CHROMEOS) && defined(USE_X11) |
200 registry->RegisterIntegerPref(prefs::kLocalProfileId, | 201 registry->RegisterIntegerPref( |
201 kInvalidLocalProfileId, | 202 prefs::kLocalProfileId, |
202 PrefRegistrySyncable::UNSYNCABLE_PREF); | 203 kInvalidLocalProfileId, |
| 204 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
203 | 205 |
204 // Notice that the preprocessor conditions above are exactly those that will | 206 // Notice that the preprocessor conditions above are exactly those that will |
205 // result in using PasswordStoreX in CreatePasswordStore() below. | 207 // result in using PasswordStoreX in CreatePasswordStore() below. |
206 PasswordStoreX::RegisterUserPrefs(registry); | 208 PasswordStoreX::RegisterUserPrefs(registry); |
207 #endif | 209 #endif |
208 } | 210 } |
209 | 211 |
210 content::BrowserContext* PasswordStoreFactory::GetBrowserContextToUse( | 212 content::BrowserContext* PasswordStoreFactory::GetBrowserContextToUse( |
211 content::BrowserContext* context) const { | 213 content::BrowserContext* context) const { |
212 return chrome::GetBrowserContextRedirectedInIncognito(context); | 214 return chrome::GetBrowserContextRedirectedInIncognito(context); |
213 } | 215 } |
214 | 216 |
215 bool PasswordStoreFactory::ServiceIsNULLWhileTesting() const { | 217 bool PasswordStoreFactory::ServiceIsNULLWhileTesting() const { |
216 return true; | 218 return true; |
217 } | 219 } |
OLD | NEW |