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_CHROMEOS_CORE_CHROMEOS_OPTIONS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CORE_CHROMEOS_OPTIONS_HANDLER_H_
10 #include "base/compiler_specific.h"
11 #include "base/memory/linked_ptr.h"
12 #include "chrome/browser/chromeos/settings/cros_settings.h"
13 #include "chrome/browser/chromeos/ui_proxy_config_service.h"
14 #include "chrome/browser/ui/webui/options/core_options_handler.h"
19 // CoreChromeOSOptionsHandler handles ChromeOS settings.
20 class CoreChromeOSOptionsHandler : public ::options::CoreOptionsHandler {
22 CoreChromeOSOptionsHandler();
23 virtual ~CoreChromeOSOptionsHandler();
25 // ::CoreOptionsHandler overrides
26 virtual void RegisterMessages() OVERRIDE;
27 virtual base::Value* FetchPref(const std::string& pref_name) OVERRIDE;
28 virtual void InitializeHandler() OVERRIDE;
29 virtual void ObservePref(const std::string& pref_name) OVERRIDE;
30 virtual void SetPref(const std::string& pref_name,
31 const base::Value* value,
32 const std::string& metric) OVERRIDE;
33 virtual void StopObservingPref(const std::string& path) OVERRIDE;
35 // OptionsPageUIHandler implementation.
36 virtual void GetLocalizedValues(
37 base::DictionaryValue* localized_strings) OVERRIDE;
40 virtual void OnPreferenceChanged(PrefService* service,
41 const std::string& pref_name) OVERRIDE;
43 // Called from Javascript to select the network to show proxy settings
44 // for. Triggers pref notifications about the updated proxy settings.
45 void SelectNetworkCallback(const base::ListValue* args);
47 // Notifies registered JS callbacks on ChromeOS setting change.
48 void NotifySettingsChanged(const std::string& setting_name);
49 void NotifyProxyPrefsChanged();
51 typedef std::map<std::string, linked_ptr<CrosSettings::ObserverSubscription> >
53 SubscriptionMap pref_subscription_map_;
55 UIProxyConfigService proxy_config_service_;
58 } // namespace options
59 } // namespace chromeos
61 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CORE_CHROMEOS_OPTIONS_HANDLER_H_