Index: chrome/browser/autofill/autofill_manager.cc |
diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc |
index 89ce8f4fb6a026a71914655b1490de436798b652..e4bc344eab208d13583fbffccd8ba8d91254401e 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/wallet_infobar_delegate.h" |
#include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
#include "chrome/common/autofill_messages.h" |
#include "chrome/common/chrome_notification_types.h" |
@@ -575,6 +576,16 @@ 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()) { |
+ InfoBarService* infobar_service = manager_delegate_->GetInfoBarService(); |
+ infobar_service->AddInfoBar( |
+ new WalletInfoBarDelegate(infobar_service, this, metric_logger_.get(), |
+ form.origin, form.ssl_status)); |
+ } |
+ |
// Add the results from AutoComplete. They come back asynchronously, so we |
// hand off what we generated and they will send the results back to the |
// renderer. |
@@ -747,6 +758,18 @@ void AutofillManager::RemoveAutocompleteEntry(const string16& name, |
autocomplete_history_manager_.OnRemoveAutocompleteEntry(name, value); |
} |
+void AutofillManager::ShowWalletDialog(const FormData& form, |
+ const GURL& frame_url, |
+ const content::SSLStatus& ssl_status) { |
+ base::Callback<void(const FormStructure*)> callback = |
+ base::Bind(&AutofillManager::ReturnWalletAutofillData, 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) { |
@@ -797,6 +820,10 @@ void AutofillManager::ReturnAutocompleteError() { |
host->Send(new AutofillMsg_RequestAutocompleteError(host->GetRoutingID())); |
} |
+void AutofillManager::ReturnWalletAutofillData(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. |