| 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. |
| 7 namespace settingsPrivate { | 7 namespace settingsPrivate { |
| 8 // Type of a pref. | 8 // Type of a pref. |
| 9 enum PrefType { BOOLEAN, NUMBER, STRING, URL, LIST }; | 9 enum PrefType { BOOLEAN, NUMBER, STRING, URL, LIST }; |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // policy. | 34 // policy. |
| 35 PolicySource? policySource; | 35 PolicySource? policySource; |
| 36 | 36 |
| 37 // The policy enforcement of the pref; must be specified if policySource is | 37 // The policy enforcement of the pref; must be specified if policySource is |
| 38 // also present. | 38 // also present. |
| 39 PolicyEnforcement? policyEnforcement; | 39 PolicyEnforcement? policyEnforcement; |
| 40 | 40 |
| 41 // The recommended value if policyEnforcement == RECOMMENDED. | 41 // The recommended value if policyEnforcement == RECOMMENDED. |
| 42 any? recommendedValue; | 42 any? recommendedValue; |
| 43 | 43 |
| 44 // The owner name if policySource == OWNER. |
| 45 // The primary user name if policySource == PRIMARY_USER. |
| 46 // The extension name if policySource == EXTENSION. |
| 47 DOMString? policySourceName; |
| 48 |
| 44 // The extension ID if policySource == EXTENSION. | 49 // The extension ID if policySource == EXTENSION. |
| 45 DOMString? extensionId; | 50 DOMString? extensionId; |
| 46 | 51 |
| 47 // True if the pref is not controlled by a policy or user, but it can not be | 52 // True if the pref is not controlled by a policy or user, but it can not be |
| 48 // modified (pref->IsUserModifiable() is false). Defaults to false. | 53 // modified (pref->IsUserModifiable() is false). Defaults to false. |
| 49 boolean? readOnly; | 54 boolean? readOnly; |
| 50 }; | 55 }; |
| 51 | 56 |
| 52 callback OnPrefSetCallback = void (boolean success); | 57 callback OnPrefSetCallback = void (boolean success); |
| 53 callback GetAllPrefsCallback = void (PrefObject[] prefs); | 58 callback GetAllPrefsCallback = void (PrefObject[] prefs); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 69 static void getPref(DOMString name, GetPrefCallback callback); | 74 static void getPref(DOMString name, GetPrefCallback callback); |
| 70 }; | 75 }; |
| 71 | 76 |
| 72 interface Events { | 77 interface Events { |
| 73 // Fired when a set of prefs has changed. | 78 // Fired when a set of prefs has changed. |
| 74 // | 79 // |
| 75 // |prefs| The prefs that changed. | 80 // |prefs| The prefs that changed. |
| 76 static void onPrefsChanged(PrefObject[] prefs); | 81 static void onPrefsChanged(PrefObject[] prefs); |
| 77 }; | 82 }; |
| 78 }; | 83 }; |
| OLD | NEW |