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..d33fadbb01ebd3e97d29c9cf31caf52fe6dd858e 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,17 @@ void AutofillManager::OnQueryFormFieldAutofill(int query_id, |
} |
} |
+ // If form is known to be at the start of the autofillable flow (i.e, when |
+ // Autofill serve said so), then trigger payments UI while also returning |
Ilya Sherman
2012/12/13 02:29:23
nit: "serve" -> "server"
Raman Kakilate
2012/12/13 21:34:34
Done.
|
+ // standard autofill suggestions to renderer process. |
+ if (form_structure->is_start_autofillable_flow()) { |
+ InfoBarService* infobar_service = manager_delegate_->GetInfoBarService(); |
+ infobar_service->AddInfoBar( |
+ new WalletInfoBarDelegate(infobar_service, personal_data_, 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 +759,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 +821,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. |