OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "chrome/browser/chrome_thread.h" | 9 #include "chrome/browser/chrome_thread.h" |
10 #include "chrome/browser/password_manager/password_store_change.h" | 10 #include "chrome/browser/password_manager/password_store_change.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 DCHECK(profile); | 28 DCHECK(profile); |
29 DCHECK(web_data_service); | 29 DCHECK(web_data_service); |
30 MigrateIfNecessary(); | 30 MigrateIfNecessary(); |
31 } | 31 } |
32 | 32 |
33 PasswordStoreDefault::~PasswordStoreDefault() { | 33 PasswordStoreDefault::~PasswordStoreDefault() { |
34 } | 34 } |
35 | 35 |
36 void PasswordStoreDefault::ReportMetricsImpl() { | 36 void PasswordStoreDefault::ReportMetricsImpl() { |
37 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); | 37 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::DB)); |
| 38 login_db_->ReportMetrics(); |
38 } | 39 } |
39 | 40 |
40 void PasswordStoreDefault::AddLoginImpl(const PasswordForm& form) { | 41 void PasswordStoreDefault::AddLoginImpl(const PasswordForm& form) { |
41 if (login_db_->AddLogin(form)) { | 42 if (login_db_->AddLogin(form)) { |
42 PasswordStoreChangeList changes; | 43 PasswordStoreChangeList changes; |
43 changes.push_back(PasswordStoreChange(PasswordStoreChange::ADD, form)); | 44 changes.push_back(PasswordStoreChange(PasswordStoreChange::ADD, form)); |
44 NotificationService::current()->Notify( | 45 NotificationService::current()->Notify( |
45 NotificationType::LOGINS_CHANGED, | 46 NotificationType::LOGINS_CHANGED, |
46 NotificationService::AllSources(), | 47 NotificationService::AllSources(), |
47 Details<PasswordStoreChangeList>(&changes)); | 48 Details<PasswordStoreChangeList>(&changes)); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 it != forms.end(); ++it) { | 154 it != forms.end(); ++it) { |
154 AddLogin(**it); | 155 AddLogin(**it); |
155 web_data_service_->RemoveLogin(**it); | 156 web_data_service_->RemoveLogin(**it); |
156 delete *it; | 157 delete *it; |
157 } | 158 } |
158 if (handles_.empty()) { | 159 if (handles_.empty()) { |
159 profile_->GetPrefs()->RegisterBooleanPref(prefs::kLoginDatabaseMigrated, | 160 profile_->GetPrefs()->RegisterBooleanPref(prefs::kLoginDatabaseMigrated, |
160 true); | 161 true); |
161 } | 162 } |
162 } | 163 } |
OLD | NEW |