Chromium Code Reviews| Index: chrome/browser/extensions/api/settings_private/settings_private_api.h |
| diff --git a/chrome/browser/extensions/api/settings_private/settings_private_api.h b/chrome/browser/extensions/api/settings_private/settings_private_api.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..edc5999ab264a9981c36aa574f2031429d8a4f14 |
| --- /dev/null |
| +++ b/chrome/browser/extensions/api/settings_private/settings_private_api.h |
| @@ -0,0 +1,103 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
|
michaelpg
2015/03/17 23:32:29
2015
Oren Blasberg
2015/03/17 23:44:45
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef EXTENSIONS_BROWSER_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_API_H_ |
|
michaelpg
2015/03/17 23:32:29
nit: should be BROWSER_EXTENSIONS not EXTENISONS_B
Oren Blasberg
2015/03/17 23:44:45
Done.
|
| +#define EXTENSIONS_BROWSER_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_API_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/values.h" |
| +#include "extensions/browser/extension_function.h" |
| + |
| +namespace extensions { |
| + |
| +namespace settings_private { |
|
James Hawkins
2015/03/17 23:28:42
This is empty; please remove.
Oren Blasberg
2015/03/17 23:44:45
Done.
|
| + |
| +} // namespace settings_private |
| + |
| +// Implements the chrome.settingsPrivate.setBooleanPref method. |
| +class SettingsPrivateSetBooleanPrefFunction : public AsyncExtensionFunction { |
| + public: |
| + SettingsPrivateSetBooleanPrefFunction() {} |
| + DECLARE_EXTENSION_FUNCTION("settingsPrivate.setBooleanPref", |
| + SETTINGSPRIVATE_SETBOOLEANPREF); |
| + |
| + protected: |
| + ~SettingsPrivateSetBooleanPrefFunction() override; |
| + |
| + // AsyncExtensionFunction overrides. |
| + bool RunAsync() override; |
| + |
| + private: |
| + void Success(); |
| + void Failure(const std::string& error_name); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SettingsPrivateSetBooleanPrefFunction); |
| +}; |
| + |
| +// Implements the chrome.settingsPrivate.setNumericPref method. |
| +class SettingsPrivateSetNumericPrefFunction : public AsyncExtensionFunction { |
| + public: |
| + SettingsPrivateSetNumericPrefFunction() {} |
| + DECLARE_EXTENSION_FUNCTION("settingsPrivate.setNumericPref", |
| + SETTINGSPRIVATE_SETNUMERICPREF); |
| + |
| + protected: |
| + ~SettingsPrivateSetNumericPrefFunction() override; |
| + |
| + // AsyncExtensionFunction overrides. |
| + bool RunAsync() override; |
| + |
| + private: |
| + void Success(); |
| + void Failure(const std::string& error); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SettingsPrivateSetNumericPrefFunction); |
| +}; |
| + |
| +// Implements the chrome.settingsPrivate.setStringPref method. |
| +class SettingsPrivateSetStringPrefFunction : public AsyncExtensionFunction { |
| + public: |
| + SettingsPrivateSetStringPrefFunction() {} |
| + DECLARE_EXTENSION_FUNCTION("settingsPrivate.setStringPref", |
| + SETTINGSPRIVATE_SETSTRINGPREF); |
| + |
| + protected: |
| + ~SettingsPrivateSetStringPrefFunction() override; |
| + |
| + // AsyncExtensionFunction overrides. |
| + bool RunAsync() override; |
| + |
| + private: |
| + void Success(); |
| + void Failure(const std::string& error); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SettingsPrivateSetStringPrefFunction); |
| +}; |
| + |
| +// Implements the chrome.settingsPrivate.getAllPrefs method. |
| +class SettingsPrivateGetAllPrefsFunction : public AsyncExtensionFunction { |
| + public: |
| + SettingsPrivateGetAllPrefsFunction() {} |
| + DECLARE_EXTENSION_FUNCTION("settingsPrivate.getAllPrefs", |
| + SETTINGSPRIVATE_GETALLPREFS); |
| + |
| + protected: |
| + ~SettingsPrivateGetAllPrefsFunction() override; |
| + |
| + // AsyncExtensionFunction overrides. |
| + bool RunAsync() override; |
| + |
| + private: |
| + void Success(scoped_ptr<base::DictionaryValue> result); |
| + void Failure(const std::string& error); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SettingsPrivateGetAllPrefsFunction); |
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // EXTENSIONS_BROWSER_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_API_H_ |