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

Side by Side Diff: chrome/common/extensions/api/_features.md

Issue 2494653005: Support API aliases (Closed)
Patch Set: update docs Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 # Extension Features Files 1 # Extension Features Files
2 2
3 [TOC] 3 [TOC]
4 4
5 ## Summary 5 ## Summary
6 6
7 The Extension features files specify the different requirements for extension 7 The Extension features files specify the different requirements for extension
8 feature availability. 8 feature availability.
9 9
10 An **extension feature** can be any component of extension capabilities. Most 10 An **extension feature** can be any component of extension capabilities. Most
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 If the parent of a feature is a complex feature, the feature system needs to 113 If the parent of a feature is a complex feature, the feature system needs to
114 know which parent to inherit from. To do this, add the property 114 know which parent to inherit from. To do this, add the property
115 `"default_parent": true` to one of the feature definitions in the parent 115 `"default_parent": true` to one of the feature definitions in the parent
116 feature. 116 feature.
117 117
118 ## Properties 118 ## Properties
119 119
120 The following properties are supported in the feature system. 120 The following properties are supported in the feature system.
121 121
122 ### alias
123
124 The `alias` property specifies that the feature has an associated alias feature.
125 Alias feature is a feature that provides the same functionality as it's source
Devlin 2016/11/17 01:11:15 An alias feature or Alias features are
tbarzic 2016/11/17 18:12:12 Done.
126 feature (i.e. the feature referenced by the alias). For example, an API alias
127 provides bindings for source API under a different name. If one wanted to
Devlin 2016/11/17 01:11:15 for _the_ source API
tbarzic 2016/11/17 18:12:12 Done.
128 declare an API alias, they would have to introduce an API alias feature -
129 defined as a feature that has `source` property, and set `alias` property on
130 the original feature. For example, the following would introduce an API alias
131 feature named `featureAlias` for API `feature`:
132 ```none
133 {
134 "feature": {
135 "contexts": ["blessed_extension"],
136 "channel": "dev",
137 "alias": "featureAlias"
138 },
139 "featureAlias": {
140 "contexts": ["blessed_extension"],
141 "channel": "dev",
142 "source": "feature"
143 }
144 }
145 ```
146 `featureAlias[source]` value specifies that `featureAlias` is an alias for API
147 feature `feature`
148
149 `feature[alias]` value specifies that `feature` API has an API alias
150 `featureAlias`
151
152 When feature `featureAlias` is available, `feature` bindings would be accessible
153 using `feauteAlias`. In other words `chrome.featureAlias` would point to an API
154 with the bindings equivalent to the bindings of `feature` API.
155
156 The alias API will inherit schema from the source API, but it will not respect
Devlin 2016/11/17 01:11:15 inherit _the_ schema
tbarzic 2016/11/17 18:12:12 Done.
157 the source API child features. To accomplish parity with the source API feature
158 children, identical child features should be added for the alias API.
Devlin 2016/11/17 01:11:15 If this becomes common, we should address it. Hop
tbarzic 2016/11/17 18:12:12 I don't expect it to become common; but, I think i
159
160 Note that to properly create an alias, both `source` property on the alias
161 feature and `alias` property on the aliased feature have to be set.
162
163 Alias features are only available for API features, and each API can have at
164 most one alias.
165 For complex features, `alias` property will be set to the `alias` value of the
166 first component simple feature that has it set.
167
122 ### blacklist 168 ### blacklist
123 169
124 The `blacklist` property specifies a list of ID hashes for extensions that 170 The `blacklist` property specifies a list of ID hashes for extensions that
125 cannot access a feature. See ID Hashes in this document for how to generate 171 cannot access a feature. See ID Hashes in this document for how to generate
126 these hashes. 172 these hashes.
127 173
128 Accepted values are lists of id hashes. 174 Accepted values are lists of id hashes.
129 175
130 ### channel 176 ### channel
131 177
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 `win`. 300 `win`.
255 301
256 ### session\_types 302 ### session\_types
257 303
258 The `session_types` property specifies in which types of sessions a feature 304 The `session_types` property specifies in which types of sessions a feature
259 should be available. The session type describes the type of user that is 305 should be available. The session type describes the type of user that is
260 logged in the current session. Session types to which feature can be restricted 306 logged in the current session. Session types to which feature can be restricted
261 are only supported on Chrome OS - features restricted to set of session types 307 are only supported on Chrome OS - features restricted to set of session types
262 will be disabled on other platforms. Also, note that all currently supported 308 will be disabled on other platforms. Also, note that all currently supported
263 session types imply that a user is logged into the session (i.e. features that 309 session types imply that a user is logged into the session (i.e. features that
264 use 'session_types' property will be disabled when a user is not logged in). 310 use `session_types` property will be disabled when a user is not logged in).
265 311
266 The accepted values are lists of strings from `regular` and `kiosk`. 312 The accepted values are lists of strings from `regular` and `kiosk`.
267 313
314 ### source
315
316 The `source` property specifies that the feature is an alias for the feature
317 specified by the property value, and is only allowed for API features.
318 For more information about alias features, see [alias](#alias) property document ation.
319
320 For complex features, `source` property will be set to the `source` value of the
321 first component simple feature that has it set.
322
268 ### whitelist 323 ### whitelist
269 324
270 The `whitelist` property specifies a list of ID hashes for extensions that 325 The `whitelist` property specifies a list of ID hashes for extensions that
271 are the only extensions allowed to access a feature. 326 are the only extensions allowed to access a feature.
272 327
273 Accepted values are lists of id hashes. 328 Accepted values are lists of id hashes.
274 329
275 ## ID Hashes 330 ## ID Hashes
276 331
277 Instead of listing the ID directly in the whitelist or blacklist section, we 332 Instead of listing the ID directly in the whitelist or blacklist section, we
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 at runtime, this has the added benefit of allowing us to validate at compile 437 at runtime, this has the added benefit of allowing us to validate at compile
383 time rather than needing a unittest (or allowing incorrect features). 438 time rather than needing a unittest (or allowing incorrect features).
384 439
385 In theory, invalid features should result in a compilation failure; in practice, 440 In theory, invalid features should result in a compilation failure; in practice,
386 the compiler is probably missing some cases. 441 the compiler is probably missing some cases.
387 442
388 ## Still to come 443 ## Still to come
389 444
390 TODO(devlin): Add documentation for extension types. Probably also more on 445 TODO(devlin): Add documentation for extension types. Probably also more on
391 requirements for individual features. 446 requirements for individual features.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698