Chromium Code Reviews| Index: components/password_manager/core/browser/password_reuse_detection_manager.cc |
| diff --git a/components/password_manager/core/browser/password_reuse_detection_manager.cc b/components/password_manager/core/browser/password_reuse_detection_manager.cc |
| index afd1a8e5035488021385296c40faf4eb227f68ad..79dbee64a4e9231ee658043d2e82ac96e19d7f45 100644 |
| --- a/components/password_manager/core/browser/password_reuse_detection_manager.cc |
| +++ b/components/password_manager/core/browser/password_reuse_detection_manager.cc |
| @@ -27,13 +27,6 @@ PasswordReuseDetectionManager::PasswordReuseDetectionManager( |
| PasswordReuseDetectionManager::~PasswordReuseDetectionManager() {} |
| -#if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) |
| -void PasswordReuseDetectionManager::SetPasswordProtectionService( |
| - base::WeakPtr<safe_browsing::PasswordProtectionService> pp_service) { |
| - password_protection_service_ = pp_service; |
| -} |
| -#endif |
| - |
| void PasswordReuseDetectionManager::DidNavigateMainFrame( |
| const GURL& main_frame_url) { |
| main_frame_url_ = main_frame_url; |
| @@ -70,9 +63,13 @@ void PasswordReuseDetectionManager::OnReuseFound( |
| metrics_util::LogPasswordReuse( |
| password.size(), saved_passwords, number_matches, |
| client_->GetPasswordManager()->IsPasswordFieldDetectedOnPage()); |
| -#if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) |
| - if (password_protection_service_) |
| - password_protection_service_->RecordPasswordReuse(main_frame_url_); |
| +#if defined(SAFE_BROWSING_DB_LOCAL) |
| + // TODO(jialiul): After CSD whitelist being added to Android, we should gate |
| + // this by either SAFE_BROWSING_DB_LOCAL or SAFE_BROWSING_DB_REMOTE. |
| + safe_browsing::PasswordProtectionService* password_protection_service = |
| + client_->GetPasswordProtectionService(); |
| + DCHECK(password_protection_service); |
|
Nathan Parker
2017/04/05 18:05:23
nit: again if you're deref'ing it immediately, I t
Jialiu Lin
2017/04/05 18:48:25
Removed DCHECK().
|
| + password_protection_service->RecordPasswordReuse(main_frame_url_); |
| #endif |
| } |