1// Copyright (c) 2011 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. 4 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_ 7#pragma once 8 9#include "chrome/browser/ui/webui/options/core_options_handler.h" 10 11namespace chromeos { 12 13// CoreChromeOSOptionsHandler handles ChromeOS settings. 14class CoreChromeOSOptionsHandler : public CoreOptionsHandler { 15 public: 16 CoreChromeOSOptionsHandler(); 17 18 protected: 19 // ::CoreOptionsHandler overrides 20 virtual Value* FetchPref(const std::string& pref_name); 21 virtual void ObservePref(const std::string& pref_name); 22 virtual void SetPref(const std::string& pref_name, 23 const Value* value, 24 const std::string& metric); 25 virtual void StopObservingPref(const std::string& path); 26 27 // NotificationObserver implementation. 28 virtual void Observe(NotificationType type, 29 const NotificationSource& source, 30 const NotificationDetails& details); 31 32 private: 33 // Notifies registered JS callbacks on ChromeOS setting change. 34 void NotifySettingsChanged(const std::string* setting_name); 35 36 // Keeps the track of change caused by the handler to make sure 37 // it does not signal itself again. 38 bool handling_change_; 39}; 40 41} // namespace chromeos 42 43#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CORE_CHROMEOS_OPTIONS_HANDLER_H_ 44