Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Use the <code>chrome.settingsPrivate</code> API to get or set preferences | 5 // Use the <code>chrome.settingsPrivate</code> API to get or set preferences |
| 6 // from the settings UI. | 6 // from the settings UI. Access is restricted to a whitelisted set of user |
|
michaelpg
2017/04/04 00:37:09
nit: user-facing
stevenjb
2017/04/04 18:18:11
meh
| |
| 7 // facing preferences. | |
| 7 namespace settingsPrivate { | 8 namespace settingsPrivate { |
| 8 enum PrefType { BOOLEAN, NUMBER, STRING, URL, LIST, DICTIONARY }; | 9 enum PrefType { BOOLEAN, NUMBER, STRING, URL, LIST, DICTIONARY }; |
| 9 | 10 |
| 10 enum ControlledBy { | 11 enum ControlledBy { |
| 11 DEVICE_POLICY, | 12 DEVICE_POLICY, |
| 12 USER_POLICY, | 13 USER_POLICY, |
| 13 OWNER, | 14 OWNER, |
| 14 PRIMARY_USER, | 15 PRIMARY_USER, |
| 15 EXTENSION | 16 EXTENSION |
| 16 }; | 17 }; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 51 boolean? extensionCanBeDisabled; | 52 boolean? extensionCanBeDisabled; |
| 52 }; | 53 }; |
| 53 | 54 |
| 54 callback OnPrefSetCallback = void (boolean success); | 55 callback OnPrefSetCallback = void (boolean success); |
| 55 callback GetAllPrefsCallback = void (PrefObject[] prefs); | 56 callback GetAllPrefsCallback = void (PrefObject[] prefs); |
| 56 callback GetPrefCallback = void (PrefObject pref); | 57 callback GetPrefCallback = void (PrefObject pref); |
| 57 callback GetDefaultZoomCallback = void (double zoom); | 58 callback GetDefaultZoomCallback = void (double zoom); |
| 58 callback SetDefaultZoomCallback = void (boolean success); | 59 callback SetDefaultZoomCallback = void (boolean success); |
| 59 | 60 |
| 60 interface Functions { | 61 interface Functions { |
| 61 // Sets a settings value. | 62 // Sets a pref value. |
| 62 // |name|: The name of the pref. | 63 // |name|: The name of the pref. |
| 63 // |value|: The new value of the pref. | 64 // |value|: The new value of the pref. |
| 64 // |pageId|: The user metrics identifier or null. | 65 // |pageId|: The user metrics identifier or null. |
| 65 // |callback|: The callback for whether the pref was set or not. | 66 // |callback|: The callback for whether the pref was set or not. |
| 66 static void setPref(DOMString name, any value, | 67 static void setPref(DOMString name, any value, |
| 67 DOMString pageId, OnPrefSetCallback callback); | 68 DOMString pageId, OnPrefSetCallback callback); |
| 68 | 69 |
| 69 // Gets an array of all the prefs. | 70 // Gets an array of all the prefs. |
| 70 static void getAllPrefs(GetAllPrefsCallback callback); | 71 static void getAllPrefs(GetAllPrefsCallback callback); |
| 71 | 72 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 82 double zoom, optional SetDefaultZoomCallback callback); | 83 double zoom, optional SetDefaultZoomCallback callback); |
| 83 }; | 84 }; |
| 84 | 85 |
| 85 interface Events { | 86 interface Events { |
| 86 // Fired when a set of prefs has changed. | 87 // Fired when a set of prefs has changed. |
| 87 // | 88 // |
| 88 // |prefs| The prefs that changed. | 89 // |prefs| The prefs that changed. |
| 89 static void onPrefsChanged(PrefObject[] prefs); | 90 static void onPrefsChanged(PrefObject[] prefs); |
| 90 }; | 91 }; |
| 91 }; | 92 }; |
| OLD | NEW |