| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/autofill/autofill_dialog.h" | 5 #include "chrome/browser/autofill/autofill_dialog.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "app/l10n_util.h" | 11 #include "app/l10n_util.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/browser/autofill/autofill_profile.h" | 15 #include "chrome/browser/autofill/autofill_profile.h" |
| 16 #include "chrome/browser/autofill/credit_card.h" | 16 #include "chrome/browser/autofill/credit_card.h" |
| 17 #include "chrome/browser/autofill/form_group.h" | 17 #include "chrome/browser/autofill/form_group.h" |
| 18 #include "chrome/browser/autofill/personal_data_manager.h" | 18 #include "chrome/browser/autofill/personal_data_manager.h" |
| 19 #include "chrome/browser/gtk/gtk_util.h" | 19 #include "chrome/browser/gtk/gtk_util.h" |
| 20 #include "chrome/browser/gtk/options/options_layout_gtk.h" | 20 #include "chrome/browser/gtk/options/options_layout_gtk.h" |
| 21 #include "chrome/browser/pref_service.h" |
| 21 #include "chrome/browser/profile.h" | 22 #include "chrome/browser/profile.h" |
| 23 #include "chrome/common/pref_names.h" |
| 22 #include "gfx/gtk_util.h" | 24 #include "gfx/gtk_util.h" |
| 23 #include "grit/chromium_strings.h" | 25 #include "grit/chromium_strings.h" |
| 24 #include "grit/generated_resources.h" | 26 #include "grit/generated_resources.h" |
| 25 #include "grit/locale_settings.h" | 27 #include "grit/locale_settings.h" |
| 26 | 28 |
| 27 namespace { | 29 namespace { |
| 28 | 30 |
| 29 // The name of the object property used to store an entry widget pointer on | 31 // The name of the object property used to store an entry widget pointer on |
| 30 // another widget. | 32 // another widget. |
| 31 const char kButtonDataKey[] = "label-entry"; | 33 const char kButtonDataKey[] = "label-entry"; |
| (...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 FALSE, FALSE, 0); | 892 FALSE, FALSE, 0); |
| 891 gtk_widget_show_all(credit_card_widget); | 893 gtk_widget_show_all(credit_card_widget); |
| 892 } | 894 } |
| 893 | 895 |
| 894 /////////////////////////////////////////////////////////////////////////////// | 896 /////////////////////////////////////////////////////////////////////////////// |
| 895 // Factory/finder method: | 897 // Factory/finder method: |
| 896 | 898 |
| 897 void ShowAutoFillDialog(gfx::NativeWindow parent, | 899 void ShowAutoFillDialog(gfx::NativeWindow parent, |
| 898 AutoFillDialogObserver* observer, | 900 AutoFillDialogObserver* observer, |
| 899 Profile *profile) { | 901 Profile *profile) { |
| 902 // It's possible we haven't shown the InfoBar yet, but if the user is in the |
| 903 // AutoFill dialog, she doesn't need to be asked to enable or disable |
| 904 // AutoFill. |
| 905 profile->GetPrefs()->SetBoolean(prefs::kAutoFillInfoBarShown, true); |
| 906 |
| 900 if (!dialog) { | 907 if (!dialog) { |
| 901 dialog = new AutoFillDialog(observer, | 908 dialog = new AutoFillDialog(observer, |
| 902 profile->GetPersonalDataManager()->profiles(), | 909 profile->GetPersonalDataManager()->profiles(), |
| 903 profile->GetPersonalDataManager()->credit_cards()); | 910 profile->GetPersonalDataManager()->credit_cards()); |
| 904 } | 911 } |
| 905 dialog->Show(); | 912 dialog->Show(); |
| 906 } | 913 } |
| OLD | NEW |