Index: chrome/browser/browsing_data/passwords_counter.cc |
diff --git a/chrome/browser/browsing_data/passwords_counter.cc b/chrome/browser/browsing_data/passwords_counter.cc |
index 6fc68cbc8f06396b5aab3594ce1a88b36745d213..4eed9093d76539954bb0198d9f1123e77617fc05 100644 |
--- a/chrome/browser/browsing_data/passwords_counter.cc |
+++ b/chrome/browser/browsing_data/passwords_counter.cc |
@@ -4,10 +4,12 @@ |
#include "chrome/browser/browsing_data/passwords_counter.h" |
#include "chrome/browser/password_manager/password_store_factory.h" |
+#include "chrome/browser/profiles/profile.h" |
#include "chrome/common/pref_names.h" |
#include "components/password_manager/core/browser/password_store.h" |
-PasswordsCounter::PasswordsCounter() : pref_name_(prefs::kDeletePasswords) {} |
+PasswordsCounter::PasswordsCounter(Profile* profile) |
+ : BrowsingDataCounter(prefs::kDeletePasswords), profile_(profile) {} |
PasswordsCounter::~PasswordsCounter() { |
if (store_) |
Bernhard Bauer
2016/06/28 14:29:39
Now that we're asserting that |store_| can never b
ioanap
2016/06/29 10:55:20
Done.
|
@@ -16,15 +18,9 @@ PasswordsCounter::~PasswordsCounter() { |
void PasswordsCounter::OnInitialized() { |
store_ = PasswordStoreFactory::GetForProfile( |
- GetProfile(), ServiceAccessType::EXPLICIT_ACCESS).get(); |
- if (store_) |
- store_->AddObserver(this); |
- else |
- LOG(ERROR) << "No password store! Cannot count passwords."; |
-} |
- |
-const std::string& PasswordsCounter::GetPrefName() const { |
- return pref_name_; |
+ profile_, ServiceAccessType::EXPLICIT_ACCESS); |
+ DCHECK(store_); |
+ store_->AddObserver(this); |
} |
void PasswordsCounter::Count() { |