Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
|
miket_OOO
2013/07/10 18:34:47
new file, current year
robliao
2013/07/10 20:20:09
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 [ | |
| 6 { | |
| 7 "namespace": "types.private", | |
| 8 "description": "The <code>chrome.types.private</code> API contains private t ype declarations for Chrome. ", | |
|
miket_OOO
2013/07/10 18:34:47
extra whitespace inside quote
robliao
2013/07/10 20:20:09
Done.
| |
| 9 "types": [ | |
| 10 { | |
| 11 "id": "ChromeDirectSetting", | |
| 12 "type": "object", | |
| 13 "js_module": "ChromeDirectSetting", | |
| 14 "customBindings": "ChromeDirectSetting", | |
| 15 "description": "An interface which allows component extensions direct ac cess to a Chrome browser setting.", | |
|
miket_OOO
2013/07/10 18:34:47
which => that (restrictive, not descriptive)
robliao
2013/07/10 20:20:09
Done.
| |
| 16 "functions": [ | |
| 17 { | |
| 18 "name": "get", | |
| 19 "type": "function", | |
| 20 "description": "Gets the value of a setting.", | |
| 21 "parameters": [ | |
| 22 { | |
| 23 "name": "details", | |
| 24 "type": "object", | |
| 25 "description": "What setting to consider.", | |
|
miket_OOO
2013/07/10 18:34:47
What => Which
robliao
2013/07/10 20:20:09
All of these maintain consistency with the publish
miket_OOO
2013/07/10 21:11:48
There's absolutely nothing stopping you from impro
| |
| 26 "properties": { | |
| 27 "incognito": { | |
| 28 "type": "boolean", | |
| 29 "optional": true, | |
| 30 "description": "Whether to return the setting that applies t o the incognito session (default false)." | |
|
miket_OOO
2013/07/10 18:34:47
Is it the setting, or the value?
robliao
2013/07/10 20:20:09
Value. Fixed.
A comment question above that was
| |
| 31 } | |
| 32 } | |
| 33 }, | |
| 34 { | |
| 35 "name": "callback", | |
| 36 "type": "function", | |
| 37 "parameters": [ | |
| 38 { | |
| 39 "name": "details", | |
| 40 "type": "object", | |
| 41 "description": "Details of the currently effective value.", | |
| 42 "properties": { | |
| 43 "value": { | |
| 44 "description": "The value of the setting.", | |
| 45 "type": "any" | |
| 46 }, | |
| 47 "incognitoSpecific": { | |
| 48 "description": "Whether the effective value is specific to the incognito session.<br>This property will <em>only</em> be present if the <var>incognito</var> property in the <var>details</var> parameter of <code>get() </code> was true.", | |
| 49 "type": "boolean", | |
| 50 "optional": true | |
| 51 } | |
| 52 } | |
| 53 } | |
| 54 ] | |
| 55 } | |
| 56 ] | |
| 57 }, | |
| 58 { | |
| 59 "name": "set", | |
| 60 "type": "function", | |
| 61 "description": "Sets the value of a setting.", | |
| 62 "parameters": [ | |
| 63 { | |
| 64 "name": "details", | |
| 65 "type": "object", | |
| 66 "description": "What setting to change.", | |
|
miket_OOO
2013/07/10 18:34:47
Which
robliao
2013/07/10 20:20:09
Done.
| |
| 67 "properties": { | |
| 68 "value": { | |
| 69 "description": "The value of the setting. <br>Note that ever y setting has a specific value type, which is described together with the settin g. An extension should <em>not</em> set a value of a different type.", | |
| 70 "type": "any" | |
| 71 }, | |
| 72 "scope": { | |
| 73 "type": "string", | |
| 74 "enum": ["regular", "regular_only", "incognito_persistent", "incognito_session_only"], | |
| 75 "optional": true, | |
| 76 "description": "Where to set the setting (default: regular). One of<br><var>regular</var>: setting for the regular profile (which is inherit ed by the incognito profile if not overridden elsewhere),<br><var>regular_only</ var>: setting for the regular profile only (not inherited by the incognito profi le),<br><var>incognito_persistent</var>: setting for the incognito profile that survives browser restarts (overrides regular preferences),<br><var>incognito_ses sion_only</var>: setting for the incognito profile that can only be set during a n incognito session and is deleted when the incognito session ends (overrides re gular and incognito_persistent preferences)." | |
|
miket_OOO
2013/07/10 18:34:47
Consider a <ul> rather than series of <br>. It mig
robliao
2013/07/10 20:20:09
The follows the style of types.json.
If we want t
| |
| 77 } | |
| 78 } | |
| 79 }, | |
| 80 { | |
| 81 "name": "callback", | |
| 82 "type": "function", | |
| 83 "description": "Called after the setting has been set.", | |
|
miket_OOO
2013/07/10 18:34:47
To be insanely hyper-technical, this description c
robliao
2013/07/10 20:20:09
This was copy+pasted from types.json.
We would ha
| |
| 84 "optional": true, | |
| 85 "parameters": [] | |
| 86 } | |
| 87 ] | |
| 88 }, | |
| 89 { | |
| 90 "name": "clear", | |
| 91 "type": "function", | |
| 92 "description": "Clears the setting. This way default settings can be come effective again.", | |
|
miket_OOO
2013/07/10 18:34:47
The style of this description isn't consistent wit
robliao
2013/07/10 20:20:09
Agreed. types.json would need to be updated.
On 20
| |
| 93 "parameters": [ | |
| 94 { | |
| 95 "name": "details", | |
| 96 "type": "object", | |
| 97 "description": "What setting to clear.", | |
|
miket_OOO
2013/07/10 18:34:47
Which
| |
| 98 "properties": { | |
| 99 "scope": { | |
| 100 "type": "string", | |
| 101 "enum": ["regular", "regular_only", "incognito_persistent", "incognito_session_only"], | |
| 102 "optional": true, | |
| 103 "description": "Where to clear the setting (default: regular ). One of<br><var>regular</var>: setting for the regular profile (which is inher ited by the incognito profile if not overridden elsewhere),<br><var>regular_only </var>: setting for the regular profile only (not inherited by the incognito pro file),<br><var>incognito_persistent</var>: setting for the incognito profile tha t survives browser restarts (overrides regular preferences),<br><var>incognito_s ession_only</var>: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences)." | |
|
miket_OOO
2013/07/10 18:34:47
I think it'd be OK to say simply that this works t
robliao
2013/07/10 20:20:09
For API reference docs, it's better to restate. So
| |
| 104 } | |
| 105 } | |
| 106 }, | |
| 107 { | |
| 108 "name": "callback", | |
| 109 "type": "function", | |
| 110 "description": "Called after the setting has been cleared.", | |
|
miket_OOO
2013/07/10 18:34:47
Same as above
robliao
2013/07/10 20:20:09
See response above.
On 2013/07/10 18:34:47, miket
| |
| 111 "optional": true, | |
| 112 "parameters": [] | |
| 113 } | |
| 114 ] | |
| 115 } | |
| 116 ], | |
| 117 "events": [ | |
| 118 { | |
| 119 "name": "onChange", | |
| 120 "description": "Fired when the value of the setting changes.", | |
|
miket_OOO
2013/07/10 18:34:47
I wonder whether "the value of" is overly verbose.
robliao
2013/07/10 20:20:09
I would be better to omit this. types.json would a
| |
| 121 "parameters": [ | |
| 122 { | |
| 123 "type": "object", | |
| 124 "name": "details", | |
| 125 "properties": { | |
| 126 "value": { | |
| 127 "description": "The value of the setting.", | |
|
miket_OOO
2013/07/10 18:34:47
The *new* value?
robliao
2013/07/10 20:20:09
The new is redundant. The setting has already chan
miket_OOO
2013/07/10 21:11:48
A common pattern in some APIs like this is to retu
| |
| 128 "type": "any" | |
| 129 }, | |
| 130 "incognitoSpecific": { | |
| 131 "description": "Whether the value that has changed is specif ic to the incognito session.<br>This property will <em>only</em> be present if t he user has enabled the extension in incognito mode.", | |
|
miket_OOO
2013/07/10 18:34:47
It's more correct to say "This property will be pr
robliao
2013/07/10 20:20:09
Agreed.
On all of these comments, if we can modi
| |
| 132 "type": "boolean", | |
| 133 "optional": true | |
| 134 } | |
| 135 } | |
| 136 } | |
| 137 ] | |
| 138 } | |
| 139 ] | |
| 140 } | |
| 141 ] | |
| 142 } | |
| 143 ] | |
| OLD | NEW |