#include "chrome/browser/password_manager/password_store_x.h"
#endif
+using password_manager::PasswordStore;
+
#if !defined(OS_CHROMEOS) && defined(USE_X11)
namespace {
#if !defined(OS_CHROMEOS) && defined(USE_X11)
LocalProfileId PasswordStoreFactory::GetLocalProfileId(
PrefService* prefs) const {
- LocalProfileId id = prefs->GetInteger(prefs::kLocalProfileId);
+ LocalProfileId id =
+ prefs->GetInteger(password_manager::prefs::kLocalProfileId);
if (id == kInvalidLocalProfileId) {
// Note that there are many more users than this. Thus, by design, this is
// not a unique id. However, it is large enough that it is very unlikely
id = rand() & kLocalProfileIdMask;
// TODO(mdm): scan other profiles to make sure they are not using this id?
} while (id == kInvalidLocalProfileId);
- prefs->SetInteger(prefs::kLocalProfileId, id);
+ prefs->SetInteger(password_manager::prefs::kLocalProfileId, id);
}
return id;
}
base::FilePath login_db_file_path = profile->GetPath();
login_db_file_path = login_db_file_path.Append(chrome::kLoginDataFileName);
- scoped_ptr<LoginDatabase> login_db(new LoginDatabase());
+ scoped_ptr<password_manager::LoginDatabase> login_db(
+ new password_manager::LoginDatabase());
{
// TODO(paivanof@gmail.com): execution of login_db->Init() should go
// to DB thread. http://crbug.com/138903
#elif defined(OS_CHROMEOS) || defined(OS_ANDROID)
// For now, we use PasswordStoreDefault. We might want to make a native
// backend for PasswordStoreX (see below) in the future though.
- ps = new PasswordStoreDefault(
+ ps = new password_manager::PasswordStoreDefault(
main_thread_runner, db_thread_runner, login_db.release());
#elif defined(USE_X11)
// On POSIX systems, we try to use the "native" password management system of
if (desktop_env == base::nix::DESKTOP_ENVIRONMENT_KDE4) {
// KDE3 didn't use DBus, which our KWallet store uses.
VLOG(1) << "Trying KWallet for password storage.";
- backend.reset(new NativeBackendKWallet(id, prefs));
+ backend.reset(new NativeBackendKWallet(id));
if (backend->Init())
VLOG(1) << "Using KWallet for password storage.";
else
desktop_env == base::nix::DESKTOP_ENVIRONMENT_XFCE) {
#if defined(USE_GNOME_KEYRING)
VLOG(1) << "Trying GNOME keyring for password storage.";
- backend.reset(new NativeBackendGnome(id, prefs));
+ backend.reset(new NativeBackendGnome(id));
if (backend->Init())
VLOG(1) << "Using GNOME keyring for password storage.";
else
login_db.release(),
backend.release());
#elif defined(USE_OZONE)
- ps = new PasswordStoreDefault(
+ ps = new password_manager::PasswordStoreDefault(
main_thread_runner, db_thread_runner, login_db.release());
#else
NOTIMPLEMENTED();
void PasswordStoreFactory::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {
#if !defined(OS_CHROMEOS) && defined(USE_X11)
+ // Notice that the preprocessor conditions above are exactly those that will
+ // result in using PasswordStoreX in BuildServiceInstanceFor().
registry->RegisterIntegerPref(
- prefs::kLocalProfileId,
+ password_manager::prefs::kLocalProfileId,
kInvalidLocalProfileId,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
-
- // Notice that the preprocessor conditions above are exactly those that will
- // result in using PasswordStoreX in CreatePasswordStore() below.
- PasswordStoreX::RegisterProfilePrefs(registry);
#endif
}