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

Unified Diff: chrome/browser/autofill/autofill_manager.cc

Issue 2949002: Add "save credit card info?" infobar for Autofill.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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
===================================================================
--- chrome/browser/autofill/autofill_manager.cc (revision 51878)
+++ chrome/browser/autofill/autofill_manager.cc (working copy)
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/string16.h"
#include "chrome/browser/autofill/autofill_dialog.h"
+#include "chrome/browser/autofill/autofill_cc_infobar_delegate.h"
#include "chrome/browser/autofill/form_structure.h"
#include "chrome/browser/pref_service.h"
#include "chrome/browser/profile.h"
@@ -402,7 +403,16 @@
if (!personal_data_->ImportFormData(import, this))
return;
- UploadFormData();
+ // Did we get credit card info?
+ AutoFillProfile* profile;
+ CreditCard* credit_card;
+ personal_data_->GetImportedFormData(&profile, &credit_card);
+
+ if (credit_card) {
+ cc_infobar_.reset(new AutoFillCCInfoBarDelegate(tab_contents_, this));
+ } else {
+ UploadFormData();
+ }
}
void AutoFillManager::UploadFormData() {
@@ -412,6 +422,12 @@
// form_is_autofilled);
}
+void AutoFillManager::OnInfoBarClosed(bool should_save) {
+ if (should_save)
+ personal_data_->SaveImportedCreditCard();
+ UploadFormData();
+}
+
AutoFillManager::AutoFillManager()
: tab_contents_(NULL),
personal_data_(NULL),

Powered by Google App Engine
This is Rietveld 408576698