Chromium Code Reviews| Index: chrome/browser/extensions/api/settings_private/settings_private_api.cc |
| diff --git a/chrome/browser/extensions/api/settings_private/settings_private_api.cc b/chrome/browser/extensions/api/settings_private/settings_private_api.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7c93f5179940f1092b84dd7e910deb80759edf90 |
| --- /dev/null |
| +++ b/chrome/browser/extensions/api/settings_private/settings_private_api.cc |
| @@ -0,0 +1,95 @@ |
| +// Copyright 2014 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. |
| + |
| +#include "chrome/browser/extensions/api/settings_private/settings_private_api.h" |
| + |
| +#include "extensions/browser/extension_function_registry.h" |
| + |
| +namespace extensions { |
| + |
| +//////////////////////////////////////////////////////////////////////////////// |
| +// SettingsPrivateSetBooleanPrefFunction |
| + |
| +SettingsPrivateSetBooleanPrefFunction:: |
| + ~SettingsPrivateSetBooleanPrefFunction() { |
| +} |
| + |
| +bool SettingsPrivateSetBooleanPrefFunction::RunAsync() { |
| + // TODO(orenb): Implement. |
| + return true; |
| +} |
| + |
| +void SettingsPrivateSetBooleanPrefFunction::Success() { |
| + SendResponse(true); |
|
michaelpg
2015/03/17 23:32:29
What is this for? ExtensionFunction says not to ca
Oren Blasberg
2015/03/17 23:44:45
IIRC, it's so that the js gets a 'success' respons
|
| +} |
| + |
| +void SettingsPrivateSetBooleanPrefFunction::Failure(const std::string& error) { |
| + error_ = error; |
| + SendResponse(false); |
| +} |
| + |
| +//////////////////////////////////////////////////////////////////////////////// |
| +// SettingsPrivateSetNumericPrefFunction |
| + |
| +SettingsPrivateSetNumericPrefFunction:: |
| + ~SettingsPrivateSetNumericPrefFunction() { |
| +} |
| + |
| +bool SettingsPrivateSetNumericPrefFunction::RunAsync() { |
| + // TODO(orenb): Implement. |
| + return true; |
| +} |
| + |
| +void SettingsPrivateSetNumericPrefFunction::Success() { |
| + SendResponse(true); |
| +} |
| + |
| +void SettingsPrivateSetNumericPrefFunction::Failure(const std::string& error) { |
| + error_ = error; |
| + SendResponse(false); |
| +} |
| + |
| +//////////////////////////////////////////////////////////////////////////////// |
| +// SettingsPrivateSetStringPrefFunction |
| + |
| +SettingsPrivateSetStringPrefFunction:: |
| + ~SettingsPrivateSetStringPrefFunction() { |
| +} |
| + |
| +bool SettingsPrivateSetStringPrefFunction::RunAsync() { |
| + // TODO(orenb): Implement. |
| + return true; |
| +} |
| + |
| +void SettingsPrivateSetStringPrefFunction::Success() { |
| + SendResponse(true); |
| +} |
| + |
| +void SettingsPrivateSetStringPrefFunction::Failure(const std::string& error) { |
| + error_ = error; |
| + SendResponse(false); |
| +} |
| + |
| +//////////////////////////////////////////////////////////////////////////////// |
| +// SettingsPrivateGetAllPrefsFunction |
| + |
| +SettingsPrivateGetAllPrefsFunction::~SettingsPrivateGetAllPrefsFunction() { |
| +} |
| + |
| +bool SettingsPrivateGetAllPrefsFunction::RunAsync() { |
| + // TODO(orenb): Implement. |
| + return true; |
| +} |
| + |
| +void SettingsPrivateGetAllPrefsFunction::Success( |
| + scoped_ptr<base::DictionaryValue> result) { |
| + SendResponse(true); |
| +} |
| + |
| +void SettingsPrivateGetAllPrefsFunction::Failure(const std::string& error) { |
| + error_ = error; |
| + SendResponse(false); |
| +} |
| + |
| +} // namespace extensions |