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

Unified Diff: components/autofill/content/renderer/autofill_agent.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: Cleanup and tests 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/autofill/content/renderer/autofill_agent.cc
diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components/autofill/content/renderer/autofill_agent.cc
index 729cbf60e2317e0c06cb96fdcf5b720886b4652f..7a123b41d8b4b0d19249f75d557d483d084114ec 100644
--- a/components/autofill/content/renderer/autofill_agent.cc
+++ b/components/autofill/content/renderer/autofill_agent.cc
@@ -34,6 +34,7 @@
#include "components/autofill/core/common/form_data_predictions.h"
#include "components/autofill/core/common/form_field_data.h"
#include "components/autofill/core/common/password_form.h"
+#include "components/autofill/core/common/password_form_fill_data.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/service_registry.h"
#include "content/public/common/ssl_status.h"
@@ -220,6 +221,8 @@ bool AutofillAgent::OnMessageReceived(const IPC::Message& message) {
OnFillPasswordSuggestion)
IPC_MESSAGE_HANDLER(AutofillMsg_PreviewPasswordSuggestion,
OnPreviewPasswordSuggestion)
+ IPC_MESSAGE_HANDLER(AutofillMsg_ShowInitialPasswordAccountSuggestions,
+ OnShowInitialPasswordAccountSuggestions);
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -595,6 +598,19 @@ void AutofillAgent::OnPreviewPasswordSuggestion(
DCHECK(handled);
}
+void AutofillAgent::OnShowInitialPasswordAccountSuggestions(
+ int key,
+ const PasswordFormFillData& form_data) {
+ std::vector<blink::WebInputElement> elements;
+ password_autofill_agent_->GetFillableElementFromFormData(key, form_data,
+ false, &elements);
+ ShowSuggestionsOptions options;
+ options.autofill_on_empty_values = true;
+ options.show_full_suggestion_list = true;
+ for (auto element : elements)
+ ShowSuggestions(element, options);
+}
+
void AutofillAgent::OnSamePageNavigationCompleted() {
if (!last_interacted_form_.isNull()) {
// Assume form submission only if the form is now gone, either invisible or

Powered by Google App Engine
This is Rietveld 408576698