diff options
author | georgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 22:39:29 +0000 |
---|---|---|
committer | georgey@chromium.org <georgey@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 22:39:29 +0000 |
commit | 21e1e7dd3aaec080af56a91c7054565234f5e289 (patch) | |
tree | 41fc890083e625d86c10583da0039e7d29648efe /chrome/browser/autofill | |
parent | 913a035151d2d72c3db96674edf67a121fa1d832 (diff) | |
download | chromium_src-21e1e7dd3aaec080af56a91c7054565234f5e289.zip chromium_src-21e1e7dd3aaec080af56a91c7054565234f5e289.tar.gz chromium_src-21e1e7dd3aaec080af56a91c7054565234f5e289.tar.bz2 |
Fixes first and third points in the bug "Autofill profile dialog box polish items".
Adds correct expand icons to the AutoFill dialog. The icons were added in a separate CL.
Moves asynchronous access to the database inside the dialog (it now shows "Loading..." while db is being connected)
Also fixes memory leak.
BUG=36601
TEST=in the bug
Review URL: http://codereview.chromium.org/669076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41780 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill')
-rw-r--r-- | chrome/browser/autofill/autofill_dialog.h | 15 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_dialog_gtk.cc | 10 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_manager.cc | 21 |
3 files changed, 33 insertions, 13 deletions
diff --git a/chrome/browser/autofill/autofill_dialog.h b/chrome/browser/autofill/autofill_dialog.h index 31b497c..ab4a7d7 100644 --- a/chrome/browser/autofill/autofill_dialog.h +++ b/chrome/browser/autofill/autofill_dialog.h @@ -7,6 +7,7 @@ #include <vector> +#include "app/gfx/native_widget_types.h" #include "chrome/browser/autofill/autofill_profile.h" #include "chrome/browser/autofill/credit_card.h" @@ -27,18 +28,24 @@ class AutoFillDialogObserver { }; // Shows the AutoFill dialog, which allows the user to edit profile information. -// |profiles| is a vector of autofill profiles that contains the current profile -// information. The dialog fills out the profile fields using this data. Any -// changes made to the profile information through the dialog should be -// transferred back into |profiles| and |credit_cards|. |observer| will be +// |profile| is profile from which you can get vectors of of autofill profiles +// that contains the current profile information and credit cards. +// The dialog fills out the profile fields using this data. |observer| will be // notified by OnAutoFillDialogAccept when the user has applied changes. // // The PersonalDataManager owns the contents of these vectors. The lifetime of // the contents is until the PersonalDataManager replaces them with new data // whenever the web database is updated. +#if defined(OS_MACOSX) +// TODO(dhollowa): update .mm files and remove this. void ShowAutoFillDialog(AutoFillDialogObserver* observer, const std::vector<AutoFillProfile*>& profiles, const std::vector<CreditCard*>& credit_cards, Profile* profile); +#else +void ShowAutoFillDialog(gfx::NativeWindow parent, + AutoFillDialogObserver* observer, + Profile* profile); +#endif #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_ diff --git a/chrome/browser/autofill/autofill_dialog_gtk.cc b/chrome/browser/autofill/autofill_dialog_gtk.cc index e447c21..d3bcb80 100644 --- a/chrome/browser/autofill/autofill_dialog_gtk.cc +++ b/chrome/browser/autofill/autofill_dialog_gtk.cc @@ -16,6 +16,7 @@ #include "chrome/browser/autofill/autofill_profile.h" #include "chrome/browser/autofill/credit_card.h" #include "chrome/browser/autofill/form_group.h" +#include "chrome/browser/autofill/personal_data_manager.h" #include "chrome/browser/gtk/gtk_util.h" #include "chrome/browser/gtk/options/options_layout_gtk.h" #include "chrome/browser/profile.h" @@ -893,12 +894,13 @@ void AutoFillDialog::AddCreditCard(const CreditCard& credit_card) { /////////////////////////////////////////////////////////////////////////////// // Factory/finder method: -void ShowAutoFillDialog(AutoFillDialogObserver* observer, - const std::vector<AutoFillProfile*>& profiles, - const std::vector<CreditCard*>& credit_cards, +void ShowAutoFillDialog(gfx::NativeWindow parent, + AutoFillDialogObserver* observer, Profile *profile) { if (!dialog) { - dialog = new AutoFillDialog(observer, profiles, credit_cards); + dialog = new AutoFillDialog(observer, + profile->GetPersonalDataManager()->profiles(), + profile->GetPersonalDataManager()->credit_cards()); } dialog->Show(); } diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc index 053a423f..b9e46e6 100644 --- a/chrome/browser/autofill/autofill_manager.cc +++ b/chrome/browser/autofill/autofill_manager.cc @@ -227,11 +227,17 @@ void AutoFillManager::OnPersonalDataLoaded() { // remove ourselves as observer. personal_data_->RemoveObserver(this); - ShowAutoFillDialog( - this, - personal_data_->web_profiles(), - personal_data_->credit_cards(), - tab_contents_->profile()->GetOriginalProfile()); +#if !defined(OS_WIN) +#if defined(OS_MACOSX) + ShowAutoFillDialog(this, + personal_data_->web_profiles(), + personal_data_->credit_cards(), + tab_contents_->profile()->GetOriginalProfile()); +#else // defined(OS_MACOSX) + ShowAutoFillDialog(NULL, this, + tab_contents_->profile()->GetOriginalProfile()); +#endif // defined(OS_MACOSX) +#endif // !defined(OS_WIN) } void AutoFillManager::OnInfoBarClosed() { @@ -254,12 +260,17 @@ void AutoFillManager::OnInfoBarAccepted() { // uploaded form structure as the initial profile in the AutoFillDialog. personal_data_->SaveImportedFormData(); +#if defined(OS_WIN) + ShowAutoFillDialog(tab_contents_->GetContentNativeView(), this, + 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 } void AutoFillManager::OnInfoBarCancelled() { |