Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Unified Diff: chrome/browser/password_manager/chrome_password_manager_client.cc

Issue 2734863004: wire PasswordProtectionService into PasswordReuseDetectionManager (Closed)
Patch Set: wire PasswordProtectionService into PasswordReuseDetectionManager Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/password_manager/chrome_password_manager_client.cc
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc
index f891985759d2f3db39c4595000910d8123d8e5b1..30420b6e07831c2a4240248a4457220c9ebca61d 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -64,6 +64,12 @@
#include "net/url_request/url_request_context.h"
#include "third_party/re2/src/re2/re2.h"
+#if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/safe_browsing/safe_browsing_service.h"
+#include "components/safe_browsing/password_protection/password_protection_service.h"
+#endif
+
#if defined(OS_ANDROID)
#include "chrome/browser/android/tab_android.h"
#include "chrome/browser/password_manager/account_chooser_dialog_android.h"
@@ -176,6 +182,15 @@ ChromePasswordManagerClient::ChromePasswordManagerClient(
password_manager::prefs::kCredentialsEnableService, GetPrefs());
ReportMetrics(*saving_and_filling_passwords_enabled_, this, profile_);
driver_factory_->RequestSendLoggingAvailability();
+
+#if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
+ if (CanSetPasswordProtectionService()) {
+ password_reuse_detection_manager_.SetPasswordProtectionService(
+ g_browser_process->safe_browsing_service()
+ ->password_protection_service()
+ ->GetWeakPtr());
+ }
+#endif
}
ChromePasswordManagerClient::~ChromePasswordManagerClient() {}
@@ -620,6 +635,14 @@ bool ChromePasswordManagerClient::ShouldAnnotateNavigationEntries(
return true;
}
+#if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE)
+bool ChromePasswordManagerClient::CanSetPasswordProtectionService() {
+ return g_browser_process && g_browser_process->safe_browsing_service() &&
+ g_browser_process->safe_browsing_service()
+ ->password_protection_service();
+}
+#endif
+
void ChromePasswordManagerClient::AnnotateNavigationEntry(
bool has_password_field) {
if (!ShouldAnnotateNavigationEntries(profile_))

Powered by Google App Engine
This is Rietveld 408576698