| 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 "chrome/browser/password_manager/login_database.h" | 9 #include "chrome/browser/password_manager/login_database.h" |
| 10 #include "chrome/browser/password_manager/password_store.h" | 10 #include "chrome/browser/password_manager/password_store.h" |
| 11 #include "chrome/browser/password_manager/password_store_default.h" | 11 #include "chrome/browser/password_manager/password_store_default.h" |
| 12 #include "chrome/browser/prefs/pref_registry_syncable.h" |
| 12 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.h" |
| 13 #include "chrome/browser/profiles/profile_dependency_manager.h" | 14 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 14 #include "chrome/browser/webdata/web_data_service.h" | 15 #include "chrome/browser/webdata/web_data_service.h" |
| 15 #include "chrome/browser/webdata/web_data_service_factory.h" | 16 #include "chrome/browser/webdata/web_data_service_factory.h" |
| 16 #include "chrome/common/chrome_constants.h" | 17 #include "chrome/common/chrome_constants.h" |
| 17 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 18 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
| 19 | 20 |
| 20 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
| 21 #include "chrome/browser/password_manager/password_store_win.h" | 22 #include "chrome/browser/password_manager/password_store_win.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 delete login_db; | 186 delete login_db; |
| 186 | 187 |
| 187 if (!ps || !ps->Init()) { | 188 if (!ps || !ps->Init()) { |
| 188 NOTREACHED() << "Could not initialize password manager."; | 189 NOTREACHED() << "Could not initialize password manager."; |
| 189 return NULL; | 190 return NULL; |
| 190 } | 191 } |
| 191 | 192 |
| 192 return ps; | 193 return ps; |
| 193 } | 194 } |
| 194 | 195 |
| 195 void PasswordStoreFactory::RegisterUserPrefs(PrefServiceSyncable* prefs) { | 196 void PasswordStoreFactory::RegisterUserPrefs(PrefRegistrySyncable* registry) { |
| 196 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID) \ | 197 #if !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && !defined(OS_ANDROID) \ |
| 197 && defined(OS_POSIX) | 198 && defined(OS_POSIX) |
| 198 prefs->RegisterIntegerPref(prefs::kLocalProfileId, | 199 registry->RegisterIntegerPref(prefs::kLocalProfileId, |
| 199 kInvalidLocalProfileId, | 200 kInvalidLocalProfileId, |
| 200 PrefServiceSyncable::UNSYNCABLE_PREF); | 201 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 201 | 202 |
| 202 // Notice that the preprocessor conditions above are exactly those that will | 203 // Notice that the preprocessor conditions above are exactly those that will |
| 203 // result in using PasswordStoreX in CreatePasswordStore() below. | 204 // result in using PasswordStoreX in CreatePasswordStore() below. |
| 204 PasswordStoreX::RegisterUserPrefs(prefs); | 205 PasswordStoreX::RegisterUserPrefs(registry); |
| 205 #endif | 206 #endif |
| 206 } | 207 } |
| 207 | 208 |
| 208 bool PasswordStoreFactory::ServiceRedirectedInIncognito() const { | 209 bool PasswordStoreFactory::ServiceRedirectedInIncognito() const { |
| 209 return true; | 210 return true; |
| 210 } | 211 } |
| 211 | 212 |
| 212 bool PasswordStoreFactory::ServiceIsNULLWhileTesting() const { | 213 bool PasswordStoreFactory::ServiceIsNULLWhileTesting() const { |
| 213 return true; | 214 return true; |
| 214 } | 215 } |
| OLD | NEW |