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. |