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 24a7c4f8e5e992bb6d7920736d3dd5d0e1914439..2605bb93f3e16ba1bea1f811690b2f7176efd659 100644 |
--- a/components/password_manager/core/browser/password_reuse_detection_manager.cc |
+++ b/components/password_manager/core/browser/password_reuse_detection_manager.cc |
@@ -9,6 +9,9 @@ |
#include "components/password_manager/core/browser/password_manager_client.h" |
#include "components/password_manager/core/browser/password_manager_metrics_util.h" |
#include "components/password_manager/core/browser/password_manager_util.h" |
+#if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) |
+#include "components/safe_browsing/password_protection/password_protection_service.h" |
+#endif |
namespace password_manager { |
@@ -20,10 +23,20 @@ PasswordReuseDetectionManager::PasswordReuseDetectionManager( |
PasswordManagerClient* client) |
: client_(client) { |
DCHECK(client_); |
+#if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) |
+ password_protection_service_ = nullptr; |
dvadym
2017/03/07 15:12:48
Nit: you can remove this line. WeekPtr's default c
Jialiu Lin
2017/03/07 18:02:16
Done.
|
+#endif |
} |
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; |
@@ -60,6 +73,9 @@ 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) |
+ password_protection_service_->RecordPasswordReuse(main_frame_url_); |
dvadym
2017/03/07 15:12:48
It looks like checking whether |password_protectio
Jialiu Lin
2017/03/07 18:02:16
Done.
|
+#endif |
} |
} // namespace password_manager |