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

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

Issue 9703038: Profiles: Really fix refcounted services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Forgot to save a file. >_< Created 8 years, 9 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_x.h" 5 #include "chrome/browser/password_manager/password_store_x.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 12 matching lines...) Expand all
23 using webkit::forms::PasswordForm; 23 using webkit::forms::PasswordForm;
24 24
25 PasswordStoreX::PasswordStoreX(LoginDatabase* login_db, 25 PasswordStoreX::PasswordStoreX(LoginDatabase* login_db,
26 Profile* profile, 26 Profile* profile,
27 WebDataService* web_data_service, 27 WebDataService* web_data_service,
28 NativeBackend* backend) 28 NativeBackend* backend)
29 : PasswordStoreDefault(login_db, profile, web_data_service), 29 : PasswordStoreDefault(login_db, profile, web_data_service),
30 backend_(backend), migration_checked_(!backend), allow_fallback_(false) { 30 backend_(backend), migration_checked_(!backend), allow_fallback_(false) {
31 } 31 }
32 32
33 PasswordStoreX::~PasswordStoreX() { 33 PasswordStoreX::~PasswordStoreX() {}
34 }
35 34
36 void PasswordStoreX::AddLoginImpl(const PasswordForm& form) { 35 void PasswordStoreX::AddLoginImpl(const PasswordForm& form) {
37 CheckMigration(); 36 CheckMigration();
38 if (use_native_backend() && backend_->AddLogin(form)) { 37 if (use_native_backend() && backend_->AddLogin(form)) {
39 PasswordStoreChangeList changes; 38 PasswordStoreChangeList changes;
40 changes.push_back(PasswordStoreChange(PasswordStoreChange::ADD, form)); 39 changes.push_back(PasswordStoreChange(PasswordStoreChange::ADD, form));
41 content::NotificationService::current()->Notify( 40 content::NotificationService::current()->Notify(
42 chrome::NOTIFICATION_LOGINS_CHANGED, 41 chrome::NOTIFICATION_LOGINS_CHANGED,
43 content::Source<PasswordStore>(this), 42 content::Source<PasswordStore>(this),
44 content::Details<PasswordStoreChangeList>(&changes)); 43 content::Details<PasswordStoreChangeList>(&changes));
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 } // anonymous namespace 294 } // anonymous namespace
296 295
297 // static 296 // static
298 void PasswordStoreX::SetPasswordsUseLocalProfileId(PrefService* prefs) { 297 void PasswordStoreX::SetPasswordsUseLocalProfileId(PrefService* prefs) {
299 // This method should work on any thread, but we expect the DB thread. 298 // This method should work on any thread, but we expect the DB thread.
300 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); 299 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
301 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 300 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
302 base::Bind(&UISetPasswordsUseLocalProfileId, prefs)); 301 base::Bind(&UISetPasswordsUseLocalProfileId, prefs));
303 } 302 }
304 #endif // !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX) 303 #endif // !defined(OS_MACOSX) && !defined(OS_CHROMEOS) && defined(OS_POSIX)
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/password_store_factory.cc ('k') | chrome/browser/plugin_data_remover_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698