Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4703)

Unified Diff: chrome/browser/extensions/api/settings_private/settings_private_api.cc

Issue 1015623005: chrome.settingsPrivate: Basic stub implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add stub implementations of the methods. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698