| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Note: Many of these functions and events are implemented by hand and should | 5 // Note: Many of these functions and events are implemented by hand and should |
| 6 // not elicit any code generation from the schema compiler. These items are | 6 // not elicit any code generation from the schema compiler. These items are |
| 7 // marked "nocompile." | 7 // marked "nocompile." |
| 8 [ | 8 [ |
| 9 { | 9 { |
| 10 "namespace": "runtime", | 10 "namespace": "runtime", |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 }, | 417 }, |
| 418 "description": "Fired when a connection is made from either an extension
process or a content script.", | 418 "description": "Fired when a connection is made from either an extension
process or a content script.", |
| 419 "parameters": [ | 419 "parameters": [ |
| 420 {"$ref": "Port", "name": "port"} | 420 {"$ref": "Port", "name": "port"} |
| 421 ] | 421 ] |
| 422 }, | 422 }, |
| 423 { | 423 { |
| 424 "name": "onConnectExternal", | 424 "name": "onConnectExternal", |
| 425 "type": "function", | 425 "type": "function", |
| 426 "nocompile": true, | 426 "nocompile": true, |
| 427 "options": { | |
| 428 "unmanaged": true | |
| 429 }, | |
| 430 "description": "Fired when a connection is made from another extension."
, | 427 "description": "Fired when a connection is made from another extension."
, |
| 431 "parameters": [ | 428 "parameters": [ |
| 432 {"$ref": "Port", "name": "port"} | 429 {"$ref": "Port", "name": "port"} |
| 433 ] | 430 ] |
| 434 }, | 431 }, |
| 435 { | 432 { |
| 436 "name": "onMessage", | 433 "name": "onMessage", |
| 437 "type": "function", | 434 "type": "function", |
| 435 "nocompile": true, |
| 438 "options": { | 436 "options": { |
| 439 "unmanaged": true | 437 "unmanaged": true |
| 440 }, | 438 }, |
| 441 "nocompile": true, | |
| 442 "description": "Fired when a message is sent from either an extension pr
ocess or a content script.", | 439 "description": "Fired when a message is sent from either an extension pr
ocess or a content script.", |
| 443 "parameters": [ | 440 "parameters": [ |
| 444 {"name": "message", "type": "any", "optional": true, "description": "T
he message sent by the calling script."}, | 441 {"name": "message", "type": "any", "optional": true, "description": "T
he message sent by the calling script."}, |
| 445 {"name": "sender", "$ref": "MessageSender" }, | 442 {"name": "sender", "$ref": "MessageSender" }, |
| 446 {"name": "sendResponse", "type": "function", "description": "Function
to call (at most once) when you have a response. The argument should be any JSON
-ifiable object. If you have more than one <code>onMessage</code> listener in th
e same document, then only one may send a response. This function becomes invali
d when the event listener returns, unless you return true from the event listene
r to indicate you wish to send a response asynchronously (this will keep the mes
sage channel open to the other end until <code>sendResponse</code> is called)."
} | 443 {"name": "sendResponse", "type": "function", "description": "Function
to call (at most once) when you have a response. The argument should be any JSON
-ifiable object. If you have more than one <code>onMessage</code> listener in th
e same document, then only one may send a response. This function becomes invali
d when the event listener returns, unless you return true from the event listene
r to indicate you wish to send a response asynchronously (this will keep the mes
sage channel open to the other end until <code>sendResponse</code> is called)."
} |
| 447 ], | 444 ], |
| 448 "returns": { | 445 "returns": { |
| 449 "type": "boolean", | 446 "type": "boolean", |
| 450 "optional": true, | 447 "optional": true, |
| 451 "description": "Return true from the event listener if you wish to cal
l <code>sendResponse</code> after the event listener returns." | 448 "description": "Return true from the event listener if you wish to cal
l <code>sendResponse</code> after the event listener returns." |
| 452 } | 449 } |
| 453 }, | 450 }, |
| 454 { | 451 { |
| 455 "name": "onMessageExternal", | 452 "name": "onMessageExternal", |
| 456 "type": "function", | 453 "type": "function", |
| 457 "options": { | |
| 458 "unmanaged": true | |
| 459 }, | |
| 460 "nocompile": true, | 454 "nocompile": true, |
| 461 "description": "Fired when a message is sent from another extension/app.
Cannot be used in a content script.", | 455 "description": "Fired when a message is sent from another extension/app.
Cannot be used in a content script.", |
| 462 "parameters": [ | 456 "parameters": [ |
| 463 {"name": "message", "type": "any", "optional": true, "description": "T
he message sent by the calling script."}, | 457 {"name": "message", "type": "any", "optional": true, "description": "T
he message sent by the calling script."}, |
| 464 {"name": "sender", "$ref": "MessageSender" }, | 458 {"name": "sender", "$ref": "MessageSender" }, |
| 465 {"name": "sendResponse", "type": "function", "description": "Function
to call (at most once) when you have a response. The argument should be any JSON
-ifiable object. If you have more than one <code>onMessage</code> listener in th
e same document, then only one may send a response. This function becomes invali
d when the event listener returns, unless you return true from the event listene
r to indicate you wish to send a response asynchronously (this will keep the mes
sage channel open to the other end until <code>sendResponse</code> is called)."
} | 459 {"name": "sendResponse", "type": "function", "description": "Function
to call (at most once) when you have a response. The argument should be any JSON
-ifiable object. If you have more than one <code>onMessage</code> listener in th
e same document, then only one may send a response. This function becomes invali
d when the event listener returns, unless you return true from the event listene
r to indicate you wish to send a response asynchronously (this will keep the mes
sage channel open to the other end until <code>sendResponse</code> is called)."
} |
| 466 ], | 460 ], |
| 467 "returns": { | 461 "returns": { |
| 468 "type": "boolean", | 462 "type": "boolean", |
| 469 "optional": true, | 463 "optional": true, |
| 470 "description": "Return true from the event listener if you wish to cal
l <code>sendResponse</code> after the event listener returns." | 464 "description": "Return true from the event listener if you wish to cal
l <code>sendResponse</code> after the event listener returns." |
| 471 } | 465 } |
| 472 }, | 466 }, |
| 473 { | 467 { |
| 474 "name": "onRestartRequired", | 468 "name": "onRestartRequired", |
| 475 "type": "function", | 469 "type": "function", |
| 476 "description": "Fired when an app or the device that it runs on needs to
be restarted. The app should close all its windows at its earliest convenient t
ime to let the restart to happen. If the app does nothing, a restart will be enf
orced after a 24-hour grace period has passed. Currently, this event is only fir
ed for Chrome OS kiosk apps.", | 470 "description": "Fired when an app or the device that it runs on needs to
be restarted. The app should close all its windows at its earliest convenient t
ime to let the restart to happen. If the app does nothing, a restart will be enf
orced after a 24-hour grace period has passed. Currently, this event is only fir
ed for Chrome OS kiosk apps.", |
| 477 "parameters": [ | 471 "parameters": [ |
| 478 { | 472 { |
| 479 "type": "string", | 473 "type": "string", |
| 480 "name": "reason", | 474 "name": "reason", |
| 481 "description": "The reason that the event is being dispatched. 'app_
update' is used when the restart is needed because the application is updated to
a newer version. 'os_update' is used when the restart is needed because the bro
wser/OS is updated to a newer version. 'periodic' is used when the system runs f
or more than the permitted uptime set in the enterprise policy.", | 475 "description": "The reason that the event is being dispatched. 'app_
update' is used when the restart is needed because the application is updated to
a newer version. 'os_update' is used when the restart is needed because the bro
wser/OS is updated to a newer version. 'periodic' is used when the system runs f
or more than the permitted uptime set in the enterprise policy.", |
| 482 "enum": ["app_update", "os_update", "periodic"] | 476 "enum": ["app_update", "os_update", "periodic"] |
| 483 } | 477 } |
| 484 ] | 478 ] |
| 485 } | 479 } |
| 486 ] | 480 ] |
| 487 } | 481 } |
| 488 ] | 482 ] |
| OLD | NEW |