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

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

Issue 1952002: AutoFill profile shouldn't be saved when cancelled during initial setup. (Closed)
Patch Set: Created 10 years, 8 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
« no previous file with comments | « chrome/browser/autofill/autofill_manager.h ('k') | chrome/browser/autofill/personal_data_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_manager.cc
diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc
index d2ddf6b5c8b7a402e68573613e9a48bab67b5c19..32c4e24ce9e5d93689c8e114eecd2579ac116b05 100644
--- a/chrome/browser/autofill/autofill_manager.cc
+++ b/chrome/browser/autofill/autofill_manager.cc
@@ -48,9 +48,6 @@ AutoFillManager::AutoFillManager(TabContents* tab_contents)
}
AutoFillManager::~AutoFillManager() {
- // This is NULL in the MockAutoFillManager.
- if (personal_data_)
- personal_data_->RemoveObserver(this);
download_manager_.SetObserver(NULL);
}
@@ -264,24 +261,6 @@ bool AutoFillManager::FillAutoFillFormData(int query_id,
return true;
}
-void AutoFillManager::OnPersonalDataLoaded() {
- // We might have been alerted that the PersonalDataManager has loaded, so
- // remove ourselves as observer.
- personal_data_->RemoveObserver(this);
-
-#if !defined(OS_WIN)
-#if defined(OS_MACOSX)
- ShowAutoFillDialog(personal_data_,
- personal_data_->web_profiles(),
- personal_data_->credit_cards(),
- tab_contents_->profile()->GetOriginalProfile());
-#else // defined(OS_MACOSX)
- ShowAutoFillDialog(NULL, personal_data_,
- tab_contents_->profile()->GetOriginalProfile());
-#endif // defined(OS_MACOSX)
-#endif // !defined(OS_WIN)
-}
-
void AutoFillManager::OnInfoBarClosed() {
PrefService* prefs = tab_contents_->profile()->GetPrefs();
prefs->SetBoolean(prefs::kAutoFillEnabled, true);
@@ -295,20 +274,18 @@ void AutoFillManager::OnInfoBarAccepted() {
prefs->SetBoolean(prefs::kAutoFillEnabled, true);
// This is the first time the user is interacting with AutoFill, so set the
- // uploaded form structure as the initial profile in the AutoFillDialog.
- personal_data_->SaveImportedFormData();
-
-#if defined(OS_WIN)
- ShowAutoFillDialog(tab_contents_->GetContentNativeView(), personal_data_,
- tab_contents_->profile()->GetOriginalProfile());
-#else
- // If the personal data manager has not loaded the data yet, set ourselves as
- // its observer so that we can listen for the OnPersonalDataLoaded signal.
- if (!personal_data_->IsDataLoaded())
- personal_data_->SetObserver(this);
- else
- OnPersonalDataLoaded();
-#endif
+ // uploaded form structure as the initial profile and credit card in the
+ // AutoFillDialog.
+ AutoFillProfile* profile = NULL;
+ CreditCard* credit_card = NULL;
+ // TODO(dhollowa) Now that we aren't immediately saving the imported form
+ // data, we should store the profile and CC in the AFM instead of the PDM.
+ personal_data_->GetImportedFormData(&profile, &credit_card);
+ ShowAutoFillDialog(tab_contents_->GetContentNativeView(),
+ personal_data_,
+ tab_contents_->profile()->GetOriginalProfile(),
+ profile,
+ credit_card);
}
void AutoFillManager::OnInfoBarCancelled() {
« no previous file with comments | « chrome/browser/autofill/autofill_manager.h ('k') | chrome/browser/autofill/personal_data_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698