Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / browser / ui / webui / options / autofill_options_handler.h
bloba98a98639e47456a3d5fba039d179f14d9f44a3e
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_AUTOFILL_OPTIONS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_AUTOFILL_OPTIONS_HANDLER_H_
8 #include <string>
10 #include "base/compiler_specific.h"
11 #include "chrome/browser/ui/webui/options/options_ui.h"
12 #include "components/autofill/core/browser/personal_data_manager_observer.h"
14 namespace autofill {
15 class PersonalDataManager;
16 } // namespace autofill
18 namespace base {
19 class DictionaryValue;
20 class ListValue;
23 namespace options {
25 class AutofillOptionsHandler : public OptionsPageUIHandler,
26 public autofill::PersonalDataManagerObserver {
27 public:
28 AutofillOptionsHandler();
29 virtual ~AutofillOptionsHandler();
31 // OptionsPageUIHandler implementation.
32 virtual void GetLocalizedValues(
33 base::DictionaryValue* localized_strings) OVERRIDE;
34 virtual void InitializeHandler() OVERRIDE;
35 virtual void InitializePage() OVERRIDE;
36 virtual void RegisterMessages() OVERRIDE;
38 // PersonalDataManagerObserver implementation.
39 virtual void OnPersonalDataChanged() OVERRIDE;
41 private:
42 // Loads the strings for the address and credit card overlays.
43 void SetAddressOverlayStrings(base::DictionaryValue* localized_strings);
44 void SetCreditCardOverlayStrings(base::DictionaryValue* localized_strings);
46 // Loads Autofill addresses and credit cards using the PersonalDataManager.
47 void LoadAutofillData();
49 // Removes data from the PersonalDataManager.
50 // |args| - A string, the GUID of the address or credit card to remove.
51 void RemoveData(const base::ListValue* args);
53 // Requests profile data for a specific address. Calls into WebUI with the
54 // loaded profile data to open the address editor.
55 // |args| - A string, the GUID of the address to load.
56 void LoadAddressEditor(const base::ListValue* args);
58 // Requests input form layout information for a specific country code. Calls
59 // into WebUI with the layout information.
60 // |args| - A string, the country code to load.
61 void LoadAddressEditorComponents(const base::ListValue* args);
63 // Requests profile data for a specific credit card. Calls into WebUI with the
64 // loaded profile data to open the credit card editor.
65 // |args| - A string, the GUID of the credit card to load.
66 void LoadCreditCardEditor(const base::ListValue* args);
68 // Adds or updates an address, depending on the GUID of the profile. If the
69 // GUID is empty, a new address is added to the WebDatabase; otherwise, the
70 // address with the matching GUID is updated. Called from WebUI.
71 // |args| - an array containing the GUID of the address followed by the
72 // address data.
73 void SetAddress(const base::ListValue* args);
75 // Adds or updates a credit card, depending on the GUID of the profile. If the
76 // GUID is empty, a new credit card is added to the WebDatabase; otherwise,
77 // the credit card with the matching GUID is updated. Called from WebUI.
78 // |args| - an array containing the GUID of the credit card followed by the
79 // credit card data.
80 void SetCreditCard(const base::ListValue* args);
82 // Validates a list of phone numbers. The resulting validated list of
83 // numbers is then sent back to the WebUI.
84 // |args| - an array containing the index of the modified or added number, the
85 // array of numbers, and the country code string set on the profile.
86 void ValidatePhoneNumbers(const base::ListValue* args);
88 // Returns true if |personal_data_| is non-null and loaded.
89 bool IsPersonalDataLoaded() const;
91 // The personal data manager, used to load Autofill profiles and credit cards.
92 // Unowned pointer, may not be NULL.
93 autofill::PersonalDataManager* personal_data_;
95 DISALLOW_COPY_AND_ASSIGN(AutofillOptionsHandler);
98 } // namespace options
100 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_AUTOFILL_OPTIONS_HANDLER_H_