Chromium Code Reviews| 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 32c1eb610a7b3794dc4ef448a4fa826e7108a571..143a1b7850e8ded967edbb7a80bbb4f401c5ed87 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() {} |
| @@ -621,6 +636,17 @@ bool ChromePasswordManagerClient::ShouldAnnotateNavigationEntries( |
| return true; |
| } |
| +#if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) |
| +bool ChromePasswordManagerClient::CanSetPasswordProtectionService() { |
| + if (g_browser_process && g_browser_process->safe_browsing_service() && |
|
dvadym
2017/03/07 15:12:47
Nit: return g_browser_process && g_browser_process
Jialiu Lin
2017/03/07 18:02:15
Done.
|
| + g_browser_process->safe_browsing_service() |
| + ->password_protection_service()) { |
| + return true; |
| + } |
| + return false; |
| +} |
| +#endif |
| + |
| void ChromePasswordManagerClient::AnnotateNavigationEntry( |
| bool has_password_field) { |
| if (!ShouldAnnotateNavigationEntries(profile_)) |