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

Unified Diff: chrome/browser/autofill/autofill_manager.cc

Issue 11539003: Pop up requestAutocomplete UI when autofill server hints chrome client that it is in a multipage au… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed Albert's comments Created 7 years, 11 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/autofill/autofill_manager.cc
diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc
index 4bba52b11c8e1af5f42633f5bb9ab7d10c2b1047..4001225881ed9a47c7eea754dbc659048c1adaa9 100644
--- a/chrome/browser/autofill/autofill_manager.cc
+++ b/chrome/browser/autofill/autofill_manager.cc
@@ -39,6 +39,7 @@
#include "chrome/browser/autofill/personal_data_manager_factory.h"
#include "chrome/browser/autofill/phone_number.h"
#include "chrome/browser/autofill/phone_number_i18n.h"
+#include "chrome/browser/autofill/autofill_flow_infobar_delegate.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/ui/autofill/autofill_dialog_controller.h"
#include "chrome/common/autofill_messages.h"
@@ -575,6 +576,17 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id,
}
}
}
+
+ // If form is known to be at the start of the autofillable flow (i.e, when
+ // Autofill server said so), then trigger payments UI while also returning
+ // standard autofill suggestions to renderer process.
+ if (form_structure->IsStartOfAutofillableFlow()) {
+ AutofillFlowInfoBarDelegate::Create(
+ manager_delegate_->GetInfoBarService(),
+ this, metric_logger_.get(),
+ form.origin,
+ form.ssl_status);
+ }
}
// Add the results from AutoComplete. They come back asynchronously, so we
@@ -749,6 +761,20 @@ void AutofillManager::RemoveAutocompleteEntry(const string16& name,
autocomplete_history_manager_.OnRemoveAutocompleteEntry(name, value);
}
+void AutofillManager::ShowAutofillFlowDialog(
+ const FormData& form, const GURL& frame_url,
+ const content::SSLStatus& ssl_status) {
+ base::Callback<void(const FormStructure*)> callback =
+ base::Bind(&AutofillManager::ReturnAutofillFlowData, this);
+ autofill::AutofillDialogController* controller =
+ new autofill::AutofillDialogController(web_contents(),
+ form,
+ frame_url,
+ ssl_status,
+ callback);
+ controller->Show();
+}
+
void AutofillManager::OnAddPasswordFormMapping(
const FormFieldData& form,
const PasswordFormFillData& fill_data) {
@@ -804,6 +830,10 @@ void AutofillManager::ReturnAutocompleteError() {
host->Send(new AutofillMsg_RequestAutocompleteError(host->GetRoutingID()));
}
+void AutofillManager::ReturnAutofillFlowData(const FormStructure* result) {
+ // TODO(ramankk): Parse the response FormStructure.
+}
+
void AutofillManager::ReturnAutocompleteData(const FormStructure* result) {
// web_contents() will be NULL when the interactive autocomplete is closed due
// to a tab or browser window closing.

Powered by Google App Engine
This is Rietveld 408576698