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

Unified Diff: chrome/common/extensions/api/settings_private.json

Issue 1015623005: chrome.settingsPrivate: Basic stub implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update API to reflect design changes. Still error on calling method. 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/common/extensions/api/settings_private.json
diff --git a/chrome/common/extensions/api/settings_private.json b/chrome/common/extensions/api/settings_private.json
new file mode 100644
index 0000000000000000000000000000000000000000..fe60b3fe16270db23d299b0c1bac6cf00aed5bb2
--- /dev/null
+++ b/chrome/common/extensions/api/settings_private.json
@@ -0,0 +1,136 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+[
+ {
+ "namespace": "settingsPrivate",
+ "description": "none",
+ "platforms": ["chromeos", "win", "mac", "linux"],
+ "properties": {
+ },
+ "types": [
+ {
+ "id": "PrefObject",
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string",
+ "optional": false,
+ "description": "The key for the setting."
stevenjb 2015/03/20 15:45:29 nit: s/setting/pref throughout the descriptions. (
Oren Blasberg 2015/03/20 18:58:53 Done.
+ },
+ "type": {
+ "type": "string",
+ "optional": false,
stevenjb 2015/03/20 15:45:29 This should be an enum.
Oren Blasberg 2015/03/20 18:58:53 Done.
+ "description": "The type of the setting."
+ },
+ "value": {
+ "type": "any",
+ "optional": true,
+ "description": "The value of the setting."
stevenjb 2015/03/20 15:45:29 nit: The current value of the setting
Oren Blasberg 2015/03/20 18:58:52 Done.
+ },
+ "source": {
+ "type": "string",
+ "optional": true,
+ "enum": ["user", "device"],
stevenjb 2015/03/20 15:45:29 , "none"
Oren Blasberg 2015/03/20 18:58:52 Adding None causes a compiler error because None i
+ "description": "The source of the setting."
+ }
+ }
+ }
+ ],
+ "functions": [
+ {
+ "name": "setBooleanPref",
+ "description": "Sets a boolean settings value.",
+ "parameters": [
+ {
+ "name": "name",
+ "type": "string"
+ },
+ {
+ "name": "value",
+ "type": "boolean"
+ }
+ ],
+ "returns": {
+ "type": "boolean",
+ "description": "Returns true if |name| matches a valid key (i.e. a PrefObject key from getAllPrefs), or returns false and sets an error if it does not."
+ }
+ },
+ {
+ "name": "setNumericPref",
+ "description": "Sets a number settings value.",
+ "parameters": [
+ {
+ "name": "name",
+ "type": "string"
+ },
+ {
+ "name": "value",
+ "type": "number"
+ }
+ ],
+ "returns": {
+ "type": "boolean",
+ "description": "Returns true if |name| matches a valid key (i.e. a PrefObject key from getAllPrefs), or returns false and sets an error if it does not."
+ }
+ },
+ {
+ "name": "setStringPref",
+ "description": "Sets a string settings value.",
+ "parameters": [
+ {
+ "name": "name",
+ "type": "string"
+ },
+ {
+ "name": "value",
+ "type": "string"
+ }
+ ],
+ "returns": {
+ "type": "boolean",
+ "description": "Returns true if |name| matches a valid key (i.e. a PrefObject key from getAllPrefs), or returns false and sets an error if it does not."
+ }
+ },
+ {
+ "name": "getAllPrefs",
+ "description": "Gets all the prefs.",
+ "parameters": [
+ {
+ "name": "callback",
+ "type": "function",
+ "parameters": [
+ {
+ "name": "prefs",
+ "type": "array",
+ "description": "The array of prefs.",
+ "items": {
+ "$ref": "PrefObject"
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "onPrefsChanged",
+ "type": "function",
+ "description": "Fired when one or more preferences are changed.",
+ "parameters": [
+ {
+ "name": "prefs",
+ "type": "array",
+ "description": "The prefs that changed, containing their new values.",
+ "items": {
+ "$ref": "PrefObject"
+ }
+ }
+ ]
+ }
+
+ ]
+ }
+]

Powered by Google App Engine
This is Rietveld 408576698