OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_AUTOFILL_OPTIONS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_AUTOFILL_OPTIONS_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_AUTOFILL_OPTIONS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_AUTOFILL_OPTIONS_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "chrome/browser/ui/webui/options/options_ui.h" | 11 #include "chrome/browser/ui/webui/options/options_ui.h" |
12 #include "components/autofill/core/browser/personal_data_manager_observer.h" | 12 #include "components/autofill/core/browser/personal_data_manager_observer.h" |
13 | 13 |
14 namespace autofill { | 14 namespace autofill { |
15 class AutofillProfile; | 15 class AutofillProfile; |
16 class PersonalDataManager; | 16 class PersonalDataManager; |
17 } // namespace autofill | 17 } // namespace autofill |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class DictionaryValue; | 20 class DictionaryValue; |
21 class ListValue; | 21 class ListValue; |
22 } | 22 } |
23 | 23 |
24 namespace options { | 24 namespace options { |
25 | 25 |
26 class AutofillOptionsHandler : public OptionsPageUIHandler, | 26 class AutofillOptionsHandler : public OptionsPageUIHandler, |
27 public autofill::PersonalDataManagerObserver { | 27 public autofill::PersonalDataManagerObserver { |
28 public: | 28 public: |
29 AutofillOptionsHandler(); | 29 AutofillOptionsHandler(); |
30 virtual ~AutofillOptionsHandler(); | 30 ~AutofillOptionsHandler() override; |
31 | 31 |
32 // OptionsPageUIHandler implementation. | 32 // OptionsPageUIHandler implementation. |
33 virtual void GetLocalizedValues( | 33 void GetLocalizedValues(base::DictionaryValue* localized_strings) override; |
34 base::DictionaryValue* localized_strings) override; | 34 void InitializeHandler() override; |
35 virtual void InitializeHandler() override; | 35 void InitializePage() override; |
36 virtual void InitializePage() override; | 36 void RegisterMessages() override; |
37 virtual void RegisterMessages() override; | |
38 | 37 |
39 // PersonalDataManagerObserver implementation. | 38 // PersonalDataManagerObserver implementation. |
40 virtual void OnPersonalDataChanged() override; | 39 void OnPersonalDataChanged() override; |
41 | 40 |
42 private: | 41 private: |
43 FRIEND_TEST_ALL_PREFIXES(AutofillOptionsHandlerTest, AddressToDictionary); | 42 FRIEND_TEST_ALL_PREFIXES(AutofillOptionsHandlerTest, AddressToDictionary); |
44 | 43 |
45 // Loads the strings for the address and credit card overlays. | 44 // Loads the strings for the address and credit card overlays. |
46 void SetAddressOverlayStrings(base::DictionaryValue* localized_strings); | 45 void SetAddressOverlayStrings(base::DictionaryValue* localized_strings); |
47 void SetCreditCardOverlayStrings(base::DictionaryValue* localized_strings); | 46 void SetCreditCardOverlayStrings(base::DictionaryValue* localized_strings); |
48 | 47 |
49 // Loads Autofill addresses and credit cards using the PersonalDataManager. | 48 // Loads Autofill addresses and credit cards using the PersonalDataManager. |
50 void LoadAutofillData(); | 49 void LoadAutofillData(); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // The personal data manager, used to load Autofill profiles and credit cards. | 105 // The personal data manager, used to load Autofill profiles and credit cards. |
107 // Unowned pointer, may not be NULL. | 106 // Unowned pointer, may not be NULL. |
108 autofill::PersonalDataManager* personal_data_; | 107 autofill::PersonalDataManager* personal_data_; |
109 | 108 |
110 DISALLOW_COPY_AND_ASSIGN(AutofillOptionsHandler); | 109 DISALLOW_COPY_AND_ASSIGN(AutofillOptionsHandler); |
111 }; | 110 }; |
112 | 111 |
113 } // namespace options | 112 } // namespace options |
114 | 113 |
115 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_AUTOFILL_OPTIONS_HANDLER_H_ | 114 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_AUTOFILL_OPTIONS_HANDLER_H_ |
OLD | NEW |