OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_DOM_UI_CORE_OPTIONS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_DOM_UI_CORE_OPTIONS_HANDLER_H_ |
| 7 |
| 8 #include "base/values.h" |
| 9 #include "chrome/browser/dom_ui/options_ui.h" |
| 10 |
| 11 // Core options UI handler. |
| 12 // Handles resource and JS calls common to all options sub-pages. |
| 13 class CoreOptionsHandler : public OptionsPageUIHandler { |
| 14 public: |
| 15 CoreOptionsHandler(); |
| 16 |
| 17 // OptionsUIHandler implementation. |
| 18 virtual void GetLocalizedValues(DictionaryValue* localized_strings); |
| 19 |
| 20 // NotificationObserver implementation. |
| 21 virtual void Observe(NotificationType type, |
| 22 const NotificationSource& source, |
| 23 const NotificationDetails& details); |
| 24 |
| 25 // DOMMessageHandler implementation. |
| 26 virtual void RegisterMessages(); |
| 27 |
| 28 private: |
| 29 // Callback for the "fetchPrefs" message. This message accepts the list of |
| 30 // preference names passed as |value| parameter (ListValue). It passes results |
| 31 // dictionary of preference values by calling prefsFetched() JS method on the |
| 32 // page. |
| 33 void HandleFetchPrefs(const Value* value); |
| 34 |
| 35 // Callback for the "observePrefs" message. This message initiates |
| 36 // notification observing for given array of preference names. |
| 37 void HandleObservePefs(const Value* value); |
| 38 |
| 39 // Callbacks for the "set<type>Pref" message. This message saves the new |
| 40 // preference value. The input value is an array of strings representing |
| 41 // name-value preference pair. |
| 42 void HandleSetBooleanPref(const Value* value); |
| 43 void HandleSetIntegerPref(const Value* value); |
| 44 void HandleSetStringPref(const Value* value); |
| 45 |
| 46 void HandleSetPref(const Value* value, Value::ValueType type); |
| 47 |
| 48 void NotifyPrefChanged(const std::wstring* pref_name); |
| 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(CoreOptionsHandler); |
| 51 }; |
| 52 |
| 53 #endif // CHROME_BROWSER_DOM_UI_CORE_OPTIONS_HANDLER_H_ |
OLD | NEW |