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

Unified Diff: components/password_manager/core/browser/password_manager.cc

Issue 2035143002: Basic implementation of showing password fill dialog on page load (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Fix iOS compile Created 4 years, 6 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: 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 0b1569db4b22ea3747b3897f4f09e1f058f94da5..766212c8e2b760ae98fe579456e90834bc4fb216 100644
--- a/components/password_manager/core/browser/password_manager.cc
+++ b/components/password_manager/core/browser/password_manager.cc
@@ -765,6 +765,32 @@ void PasswordManager::Autofill(
&federated_matches);
}
+void PasswordManager::ShowInitialPasswordAccountSuggestions(
+ password_manager::PasswordManagerDriver* driver,
+ const PasswordForm& form_for_autofill,
+ const PasswordFormMap& best_matches,
+ const std::vector<std::unique_ptr<PasswordForm>>& federated_matches,
+ const PasswordForm& preferred_match,
+ bool wait_for_username) const {
+ DCHECK_EQ(PasswordForm::SCHEME_HTML, preferred_match.scheme);
+
+ std::unique_ptr<BrowserSavePasswordProgressLogger> logger;
+ if (password_manager_util::IsLoggingActive(client_)) {
+ logger.reset(
+ new BrowserSavePasswordProgressLogger(client_->GetLogManager()));
+ logger->LogMessage(
+ Logger::
+ STRING_PASSWORDMANAGER_SHOW_INITIAL_PASSWORD_ACCOUNT_SUGGESTIONS);
+ }
+ autofill::PasswordFormFillData fill_data;
+ InitPasswordFormFillData(form_for_autofill, best_matches, &preferred_match,
+ wait_for_username, OtherPossibleUsernamesEnabled(),
+ &fill_data);
+ if (logger)
+ logger->LogBoolean(Logger::STRING_WAIT_FOR_USERNAME, wait_for_username);
+ driver->ShowInitialPasswordAccountSuggestions(fill_data);
+}
+
void PasswordManager::AutofillHttpAuth(
const PasswordFormMap& best_matches,
const PasswordForm& preferred_match) const {

Powered by Google App Engine
This is Rietveld 408576698