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

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: Convert AutocheckoutManager to use WeakPtr instead of RefCounted. 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 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),

Powered by Google App Engine
This is Rietveld 408576698