diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-19 20:06:51 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-19 20:06:51 +0000 |
commit | e08b6c407b50b8d003d1c9d38eda16d9c0010f18 (patch) | |
tree | 629fac1acaa3f691023fc27d7eb67d858c0e215e | |
parent | 10d0b23d89dd21d2ca219c19c5d9bd93901f80d4 (diff) | |
download | chromium_src-e08b6c407b50b8d003d1c9d38eda16d9c0010f18.zip chromium_src-e08b6c407b50b8d003d1c9d38eda16d9c0010f18.tar.gz chromium_src-e08b6c407b50b8d003d1c9d38eda16d9c0010f18.tar.bz2 |
AutoFill: Set the kAutoFillInfoBarShown pref to true if the user opens the AutoFill dialog. If the user has opened the dialog, AutoFill is implicitly enabled.
BUG=38538
TEST=none
Review URL: http://codereview.chromium.org/1077003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42139 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/autofill/autofill_dialog_gtk.cc | 7 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_dialog_mac.mm | 7 | ||||
-rw-r--r-- | chrome/browser/views/autofill_profiles_view_win.cc | 9 |
3 files changed, 22 insertions, 1 deletions
diff --git a/chrome/browser/autofill/autofill_dialog_gtk.cc b/chrome/browser/autofill/autofill_dialog_gtk.cc index afbd0c4..6abae96 100644 --- a/chrome/browser/autofill/autofill_dialog_gtk.cc +++ b/chrome/browser/autofill/autofill_dialog_gtk.cc @@ -18,7 +18,9 @@ #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/pref_service.h" #include "chrome/browser/profile.h" +#include "chrome/common/pref_names.h" #include "gfx/gtk_util.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -897,6 +899,11 @@ void AutoFillDialog::AddCreditCard(const CreditCard& credit_card) { void ShowAutoFillDialog(gfx::NativeWindow parent, AutoFillDialogObserver* observer, Profile *profile) { + // It's possible we haven't shown the InfoBar yet, but if the user is in the + // AutoFill dialog, she doesn't need to be asked to enable or disable + // AutoFill. + profile->GetPrefs()->SetBoolean(prefs::kAutoFillInfoBarShown, true); + if (!dialog) { dialog = new AutoFillDialog(observer, profile->GetPersonalDataManager()->profiles(), diff --git a/chrome/browser/autofill/autofill_dialog_mac.mm b/chrome/browser/autofill/autofill_dialog_mac.mm index d23236b..c011822 100644 --- a/chrome/browser/autofill/autofill_dialog_mac.mm +++ b/chrome/browser/autofill/autofill_dialog_mac.mm @@ -4,7 +4,9 @@ #import "chrome/browser/autofill/autofill_dialog_controller_mac.h" #include "chrome/browser/autofill/autofill_dialog.h" +#include "chrome/browser/pref_service.h" #include "chrome/browser/profile.h" +#include "chrome/common/pref_names.h" // Mac implementation of |ShowAutoFillDialog| interface defined in // |chrome/browser/autofill/autofill_dialog.h|. @@ -12,6 +14,11 @@ void ShowAutoFillDialog(AutoFillDialogObserver* observer, const std::vector<AutoFillProfile*>& profiles, const std::vector<CreditCard*>& credit_cards, Profile *profile) { + // It's possible we haven't shown the InfoBar yet, but if the user is in the + // AutoFill dialog, she doesn't need to be asked to enable or disable + // AutoFill. + profile->GetPrefs()->SetBoolean(prefs::kAutoFillInfoBarShown, true); + [AutoFillDialogController showAutoFillDialogWithObserver:observer autoFillProfiles:profiles diff --git a/chrome/browser/views/autofill_profiles_view_win.cc b/chrome/browser/views/autofill_profiles_view_win.cc index ff88e82..0d9dc0b 100644 --- a/chrome/browser/views/autofill_profiles_view_win.cc +++ b/chrome/browser/views/autofill_profiles_view_win.cc @@ -13,9 +13,11 @@ #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_window.h" +#include "chrome/browser/pref_service.h" #include "chrome/browser/profile.h" #include "chrome/browser/theme_resources_util.h" #include "chrome/browser/window_sizer.h" +#include "chrome/common/pref_names.h" #include "gfx/native_theme_win.h" #include "gfx/size.h" #include "grit/generated_resources.h" @@ -1159,9 +1161,14 @@ void ShowAutoFillDialog(gfx::NativeWindow parent, AutoFillDialogObserver* observer, Profile* profile) { DCHECK(profile); + + // It's possible we haven't shown the InfoBar yet, but if the user is in the + // AutoFill dialog, she doesn't need to be asked to enable or disable + // AutoFill. + profile->GetPrefs()->SetBoolean(prefs::kAutoFillInfoBarShown, true); + PersonalDataManager* personal_data_manager = profile->GetPersonalDataManager(); DCHECK(personal_data_manager); AutoFillProfilesView::Show(parent, observer, personal_data_manager); } - |