Chromium Code Reviews| Index: components/password_manager/core/browser/password_manager.cc |
| diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc |
| index 8f9c6faeb1449bfa44e431eedc262b9cf2021077..f39051fb6716887568d79cee805d001c4d71ca5c 100644 |
| --- a/components/password_manager/core/browser/password_manager.cc |
| +++ b/components/password_manager/core/browser/password_manager.cc |
| @@ -15,6 +15,7 @@ |
| #include "components/autofill/core/browser/form_structure.h" |
| #include "components/autofill/core/common/form_data_predictions.h" |
| #include "components/autofill/core/common/password_form_field_prediction_map.h" |
| +#include "components/password_manager/core/browser/affiliation_utils.h" |
| #include "components/password_manager/core/browser/browser_save_password_progress_logger.h" |
| #include "components/password_manager/core/browser/password_autofill_manager.h" |
| #include "components/password_manager/core/browser/password_form_manager.h" |
| @@ -110,6 +111,19 @@ bool ServerTypeToPrediction(autofill::ServerFieldType server_field_type, |
| return true; |
| } |
| +bool ContainsAndroidCredentials( |
| + const autofill::PasswordFormFillData& fill_data) { |
|
vabr (Chromium)
2015/06/18 13:21:47
Note that the declaration comment for PasswordForm
msramek
2015/06/18 14:22:27
My understanding is that no. We're looking for the
vabr (Chromium)
2015/06/18 15:59:02
Acknowledged. The Webview should not fill password
|
| + for (const auto& login : fill_data.additional_logins) { |
| + if (FacetURI::FromPotentiallyInvalidSpec( |
| + login.second.realm).IsValidAndroidFacetURI()) { |
| + return true; |
| + } |
| + } |
| + |
| + return FacetURI::FromPotentiallyInvalidSpec( |
| + fill_data.preferred_realm).IsValidAndroidFacetURI(); |
| +} |
| + |
| } // namespace |
| // static |
| @@ -671,6 +685,8 @@ void PasswordManager::Autofill(password_manager::PasswordManagerDriver* driver, |
| &fill_data); |
| if (logger) |
| logger->LogBoolean(Logger::STRING_WAIT_FOR_USERNAME, wait_for_username); |
| + UMA_HISTOGRAM_BOOLEAN("PasswordManager.OfferedToFillAndroidCredentials", |
| + ContainsAndroidCredentials(fill_data)); |
| driver->FillPasswordForm(fill_data); |
| break; |
| } |