Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Side by Side Diff: chrome/browser/password_manager/password_store_default.cc

Issue 6905044: Refactor preference syncing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Really fix. And rebase Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/password_manager/password_store_default.h" 5 #include "chrome/browser/password_manager/password_store_default.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util-inl.h" 10 #include "base/stl_util-inl.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 const PasswordForms& forms = 87 const PasswordForms& forms =
88 static_cast<const WDResult<PasswordForms>*>(result)->GetValue(); 88 static_cast<const WDResult<PasswordForms>*>(result)->GetValue();
89 for (PasswordForms::const_iterator it = forms.begin(); 89 for (PasswordForms::const_iterator it = forms.begin();
90 it != forms.end(); ++it) { 90 it != forms.end(); ++it) {
91 password_store_->AddLogin(**it); 91 password_store_->AddLogin(**it);
92 web_data_service_->RemoveLogin(**it); 92 web_data_service_->RemoveLogin(**it);
93 delete *it; 93 delete *it;
94 } 94 }
95 if (handles_.empty()) { 95 if (handles_.empty()) {
96 profile_->GetPrefs()->RegisterBooleanPref(prefs::kLoginDatabaseMigrated, 96 profile_->GetPrefs()->RegisterBooleanPref(prefs::kLoginDatabaseMigrated,
97 true); 97 true,
98 PrefService::UNSYNCABLE_PREF);
98 } 99 }
99 } 100 }
100 101
101 PasswordStoreDefault::PasswordStoreDefault(LoginDatabase* login_db, 102 PasswordStoreDefault::PasswordStoreDefault(LoginDatabase* login_db,
102 Profile* profile, 103 Profile* profile,
103 WebDataService* web_data_service) 104 WebDataService* web_data_service)
104 : web_data_service_(web_data_service), 105 : web_data_service_(web_data_service),
105 login_db_(login_db), profile_(profile) { 106 login_db_(login_db), profile_(profile) {
106 DCHECK(login_db); 107 DCHECK(login_db);
107 DCHECK(profile); 108 DCHECK(profile);
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 209 }
209 210
210 void PasswordStoreDefault::MigrateIfNecessary() { 211 void PasswordStoreDefault::MigrateIfNecessary() {
211 PrefService* prefs = profile_->GetPrefs(); 212 PrefService* prefs = profile_->GetPrefs();
212 if (prefs->FindPreference(prefs::kLoginDatabaseMigrated)) 213 if (prefs->FindPreference(prefs::kLoginDatabaseMigrated))
213 return; 214 return;
214 DCHECK(!migrate_helper_.get()); 215 DCHECK(!migrate_helper_.get());
215 migrate_helper_.reset(new MigrateHelper(profile_, web_data_service_, this)); 216 migrate_helper_.reset(new MigrateHelper(profile_, web_data_service_, this));
216 migrate_helper_->Init(); 217 migrate_helper_->Init();
217 } 218 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698