| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/browsing_data/passwords_counter.h" | 5 #include "chrome/browser/browsing_data/passwords_counter.h" |
| 6 #include "chrome/browser/password_manager/password_store_factory.h" | 6 #include "chrome/browser/password_manager/password_store_factory.h" |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/common/pref_names.h" | 8 #include "components/browsing_data/pref_names.h" |
| 9 #include "components/password_manager/core/browser/password_store.h" | 9 #include "components/password_manager/core/browser/password_store.h" |
| 10 | 10 |
| 11 PasswordsCounter::PasswordsCounter(Profile* profile) | 11 PasswordsCounter::PasswordsCounter(Profile* profile) |
| 12 : BrowsingDataCounter(prefs::kDeletePasswords), profile_(profile) {} | 12 : BrowsingDataCounter(browsing_data::prefs::kDeletePasswords), |
| 13 profile_(profile) {} |
| 13 | 14 |
| 14 PasswordsCounter::~PasswordsCounter() { | 15 PasswordsCounter::~PasswordsCounter() { |
| 15 store_->RemoveObserver(this); | 16 store_->RemoveObserver(this); |
| 16 } | 17 } |
| 17 | 18 |
| 18 void PasswordsCounter::OnInitialized() { | 19 void PasswordsCounter::OnInitialized() { |
| 19 store_ = PasswordStoreFactory::GetForProfile( | 20 store_ = PasswordStoreFactory::GetForProfile( |
| 20 profile_, ServiceAccessType::EXPLICIT_ACCESS); | 21 profile_, ServiceAccessType::EXPLICIT_ACCESS); |
| 21 DCHECK(store_); | 22 DCHECK(store_); |
| 22 store_->AddObserver(this); | 23 store_->AddObserver(this); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 39 results.end(), | 40 results.end(), |
| 40 [start](const autofill::PasswordForm* form) { | 41 [start](const autofill::PasswordForm* form) { |
| 41 return form->date_created >= start; | 42 return form->date_created >= start; |
| 42 })); | 43 })); |
| 43 } | 44 } |
| 44 | 45 |
| 45 void PasswordsCounter::OnLoginsChanged( | 46 void PasswordsCounter::OnLoginsChanged( |
| 46 const password_manager::PasswordStoreChangeList& changes) { | 47 const password_manager::PasswordStoreChangeList& changes) { |
| 47 Restart(); | 48 Restart(); |
| 48 } | 49 } |
| OLD | NEW |