Chromium Code Reviews| Index: chrome/browser/autofill/autofill_manager.cc |
| diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc |
| index b66683f6f2f980533c2158494d96e0c9ad7986ca..00eeb45fa09d839ce2c719d404f527368de586da 100644 |
| --- a/chrome/browser/autofill/autofill_manager.cc |
| +++ b/chrome/browser/autofill/autofill_manager.cc |
| @@ -23,6 +23,8 @@ |
| #include "base/utf_string_conversions.h" |
| #include "chrome/browser/api/infobars/infobar_service.h" |
| #include "chrome/browser/api/sync/profile_sync_service_base.h" |
| +#include "chrome/browser/autofill/autocheckout_manager.h" |
| +#include "chrome/browser/autofill/autocheckout_infobar_delegate.h" |
| #include "chrome/browser/autofill/autocomplete_history_manager.h" |
| #include "chrome/browser/autofill/autofill_cc_infobar_delegate.h" |
| #include "chrome/browser/autofill/autofill_country.h" |
| @@ -200,6 +202,7 @@ AutofillManager::AutofillManager(content::WebContents* web_contents, |
| download_manager_(delegate->GetBrowserContext(), this), |
| disable_download_manager_requests_(false), |
| autocomplete_history_manager_(web_contents), |
| + autocheckout_manager_(new AutocheckoutManager), |
| metric_logger_(new AutofillMetrics), |
| has_logged_autofill_enabled_(false), |
| has_logged_address_suggestions_count_(false), |
| @@ -575,6 +578,18 @@ 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()) { |
| + AutocheckoutInfoBarDelegate::Create( |
| + *metric_logger_.get(), |
|
Ilya Sherman
2013/01/17 23:48:12
nit: Omit the ".get()"
Raman Kakilate
2013/01/18 01:17:13
Done.
|
| + form.origin, |
| + form.ssl_status, |
| + this, |
| + manager_delegate_->GetInfoBarService()); |
| + } |
| } |
| // Add the results from AutoComplete. They come back asynchronously, so we |
| @@ -749,6 +764,12 @@ void AutofillManager::RemoveAutocompleteEntry(const string16& name, |
| autocomplete_history_manager_.OnRemoveAutocompleteEntry(name, value); |
| } |
| +void AutofillManager::ShowAutocheckoutDialog( |
| + const GURL& frame_url, const content::SSLStatus& ssl_status) { |
| + autocheckout_manager_->ShowAutocheckoutDialog(frame_url, ssl_status, |
| + web_contents()); |
| +} |
| + |
| void AutofillManager::OnAddPasswordFormMapping( |
| const FormFieldData& form, |
| const PasswordFormFillData& fill_data) { |
| @@ -947,6 +968,7 @@ AutofillManager::AutofillManager(content::WebContents* web_contents, |
| download_manager_(delegate->GetBrowserContext(), this), |
| disable_download_manager_requests_(true), |
| autocomplete_history_manager_(web_contents), |
| + autocheckout_manager_(new AutocheckoutManager), |
| metric_logger_(new AutofillMetrics), |
| has_logged_autofill_enabled_(false), |
| has_logged_address_suggestions_count_(false), |