Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 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_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_API_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_API_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/values.h" | |
| 13 #include "extensions/browser/extension_function.h" | |
| 14 | |
| 15 namespace extensions { | |
| 16 | |
| 17 // Implements the chrome.settingsPrivate.setBooleanPref method. | |
| 18 class SettingsPrivateSetBooleanPrefFunction : public UIThreadExtensionFunction { | |
| 19 public: | |
| 20 SettingsPrivateSetBooleanPrefFunction() {} | |
| 21 DECLARE_EXTENSION_FUNCTION("settingsPrivate.setBooleanPref", | |
| 22 SETTINGSPRIVATE_SETBOOLEANPREF); | |
| 23 | |
| 24 protected: | |
| 25 ~SettingsPrivateSetBooleanPrefFunction() override; | |
| 26 | |
| 27 // ExtensionFunction overrides. | |
| 28 ResponseAction Run() override; | |
| 29 | |
| 30 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateSetBooleanPrefFunction); | |
| 31 }; | |
| 32 | |
| 33 // Implements the chrome.settingsPrivate.setNumericPref method. | |
| 34 class SettingsPrivateSetNumericPrefFunction : public UIThreadExtensionFunction { | |
|
michaelpg
2015/03/23 22:58:56
I maintain that when we implement this API we shou
| |
| 35 public: | |
| 36 SettingsPrivateSetNumericPrefFunction() {} | |
| 37 DECLARE_EXTENSION_FUNCTION("settingsPrivate.setNumericPref", | |
| 38 SETTINGSPRIVATE_SETNUMERICPREF); | |
| 39 | |
| 40 protected: | |
| 41 ~SettingsPrivateSetNumericPrefFunction() override; | |
| 42 | |
| 43 // ExtensionFunction overrides. | |
| 44 ResponseAction Run() override; | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateSetNumericPrefFunction); | |
| 47 }; | |
| 48 | |
| 49 // Implements the chrome.settingsPrivate.setStringPref method. | |
| 50 class SettingsPrivateSetStringPrefFunction : public UIThreadExtensionFunction { | |
| 51 public: | |
| 52 SettingsPrivateSetStringPrefFunction() {} | |
| 53 DECLARE_EXTENSION_FUNCTION("settingsPrivate.setStringPref", | |
| 54 SETTINGSPRIVATE_SETSTRINGPREF); | |
| 55 | |
| 56 protected: | |
| 57 ~SettingsPrivateSetStringPrefFunction() override; | |
| 58 | |
| 59 // ExtensionFunction overrides. | |
| 60 ResponseAction Run() override; | |
| 61 | |
| 62 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateSetStringPrefFunction); | |
| 63 }; | |
| 64 | |
| 65 // Implements the chrome.settingsPrivate.setURLPref method. | |
| 66 class SettingsPrivateSetURLPrefFunction : public UIThreadExtensionFunction { | |
| 67 public: | |
| 68 SettingsPrivateSetURLPrefFunction() {} | |
| 69 DECLARE_EXTENSION_FUNCTION("settingsPrivate.setURLPref", | |
| 70 SETTINGSPRIVATE_SETURLPREF); | |
| 71 | |
| 72 protected: | |
| 73 ~SettingsPrivateSetURLPrefFunction() override; | |
| 74 | |
| 75 // ExtensionFunction overrides. | |
| 76 ResponseAction Run() override; | |
| 77 | |
| 78 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateSetURLPrefFunction); | |
| 79 }; | |
| 80 | |
| 81 // Implements the chrome.settingsPrivate.getAllPrefs method. | |
| 82 class SettingsPrivateGetAllPrefsFunction : public UIThreadExtensionFunction { | |
| 83 public: | |
| 84 SettingsPrivateGetAllPrefsFunction() {} | |
| 85 DECLARE_EXTENSION_FUNCTION("settingsPrivate.getAllPrefs", | |
| 86 SETTINGSPRIVATE_GETALLPREFS); | |
| 87 | |
| 88 protected: | |
| 89 ~SettingsPrivateGetAllPrefsFunction() override; | |
| 90 | |
| 91 // AsyncExtensionFunction overrides. | |
| 92 ResponseAction Run() override; | |
| 93 | |
| 94 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateGetAllPrefsFunction); | |
| 95 }; | |
| 96 | |
| 97 // Implements the chrome.settingsPrivate.getPref method. | |
| 98 class SettingsPrivateGetPrefFunction : public UIThreadExtensionFunction { | |
| 99 public: | |
| 100 SettingsPrivateGetPrefFunction() {} | |
| 101 DECLARE_EXTENSION_FUNCTION("settingsPrivate.getPref", | |
| 102 SETTINGSPRIVATE_GETPREF); | |
| 103 | |
| 104 protected: | |
| 105 ~SettingsPrivateGetPrefFunction() override; | |
| 106 | |
| 107 // AsyncExtensionFunction overrides. | |
| 108 ResponseAction Run() override; | |
| 109 | |
| 110 DISALLOW_COPY_AND_ASSIGN(SettingsPrivateGetPrefFunction); | |
| 111 }; | |
| 112 | |
| 113 } // namespace extensions | |
| 114 | |
| 115 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_API_H _ | |
| OLD | NEW |