OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // IPC messages for extensions. | 5 // IPC messages for extensions. |
6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 IPC_STRUCT_MEMBER(int, run_at) | 115 IPC_STRUCT_MEMBER(int, run_at) |
116 | 116 |
117 // Whether to execute code in the main world (as opposed to an isolated | 117 // Whether to execute code in the main world (as opposed to an isolated |
118 // world). | 118 // world). |
119 IPC_STRUCT_MEMBER(bool, in_main_world) | 119 IPC_STRUCT_MEMBER(bool, in_main_world) |
120 | 120 |
121 // Whether the request is coming from a <webview>. | 121 // Whether the request is coming from a <webview>. |
122 IPC_STRUCT_MEMBER(bool, is_web_view) | 122 IPC_STRUCT_MEMBER(bool, is_web_view) |
123 IPC_STRUCT_END() | 123 IPC_STRUCT_END() |
124 | 124 |
| 125 // Struct containing the data for external connections to extensions. Used to |
| 126 // handle the IPCs initiated by both connect() and onConnect(). |
| 127 IPC_STRUCT_BEGIN(ExtensionMsg_ExternalConnectionInfo) |
| 128 // The ID of the extension that is the target of the request. |
| 129 IPC_STRUCT_MEMBER(std::string, target_id) |
| 130 |
| 131 // The ID of the extension that initiated the request. May be empty if it |
| 132 // wasn't initiated by an extension. |
| 133 IPC_STRUCT_MEMBER(std::string, source_id) |
| 134 |
| 135 // The URL of the frame that initiated the request. |
| 136 IPC_STRUCT_MEMBER(GURL, source_url) |
| 137 IPC_STRUCT_END() |
| 138 |
125 IPC_STRUCT_TRAITS_BEGIN(WebApplicationInfo::IconInfo) | 139 IPC_STRUCT_TRAITS_BEGIN(WebApplicationInfo::IconInfo) |
126 IPC_STRUCT_TRAITS_MEMBER(url) | 140 IPC_STRUCT_TRAITS_MEMBER(url) |
127 IPC_STRUCT_TRAITS_MEMBER(width) | 141 IPC_STRUCT_TRAITS_MEMBER(width) |
128 IPC_STRUCT_TRAITS_MEMBER(height) | 142 IPC_STRUCT_TRAITS_MEMBER(height) |
129 IPC_STRUCT_TRAITS_MEMBER(data) | 143 IPC_STRUCT_TRAITS_MEMBER(data) |
130 IPC_STRUCT_TRAITS_END() | 144 IPC_STRUCT_TRAITS_END() |
131 | 145 |
132 IPC_STRUCT_TRAITS_BEGIN(WebApplicationInfo) | 146 IPC_STRUCT_TRAITS_BEGIN(WebApplicationInfo) |
133 IPC_STRUCT_TRAITS_MEMBER(title) | 147 IPC_STRUCT_TRAITS_MEMBER(title) |
134 IPC_STRUCT_TRAITS_MEMBER(description) | 148 IPC_STRUCT_TRAITS_MEMBER(description) |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 int32 /* install id */, | 403 int32 /* install id */, |
390 bool /* whether the install was successful */, | 404 bool /* whether the install was successful */, |
391 std::string /* error */) | 405 std::string /* error */) |
392 | 406 |
393 // Response to the renderer for ExtensionHostMsg_GetAppInstallState. | 407 // Response to the renderer for ExtensionHostMsg_GetAppInstallState. |
394 IPC_MESSAGE_ROUTED2(ExtensionMsg_GetAppInstallStateResponse, | 408 IPC_MESSAGE_ROUTED2(ExtensionMsg_GetAppInstallStateResponse, |
395 std::string /* state */, | 409 std::string /* state */, |
396 int32 /* callback_id */) | 410 int32 /* callback_id */) |
397 | 411 |
398 // Dispatch the Port.onConnect event for message channels. | 412 // Dispatch the Port.onConnect event for message channels. |
399 IPC_MESSAGE_ROUTED5(ExtensionMsg_DispatchOnConnect, | 413 IPC_MESSAGE_ROUTED4(ExtensionMsg_DispatchOnConnect, |
400 int /* target_port_id */, | 414 int /* target_port_id */, |
401 std::string /* channel_name */, | 415 std::string /* channel_name */, |
402 std::string /* tab_json */, | 416 DictionaryValue /* source_tab */, |
403 std::string /* source_extension_id */, | 417 ExtensionMsg_ExternalConnectionInfo) |
404 std::string /* target_extension_id */) | |
405 | 418 |
406 // Deliver a message sent with ExtensionHostMsg_PostMessage. | 419 // Deliver a message sent with ExtensionHostMsg_PostMessage. |
407 IPC_MESSAGE_ROUTED2(ExtensionMsg_DeliverMessage, | 420 IPC_MESSAGE_ROUTED2(ExtensionMsg_DeliverMessage, |
408 int /* target_port_id */, | 421 int /* target_port_id */, |
409 std::string /* message */) | 422 std::string /* message */) |
410 | 423 |
411 // Dispatch the Port.onDisconnect event for message channels. | 424 // Dispatch the Port.onDisconnect event for message channels. |
412 IPC_MESSAGE_ROUTED2(ExtensionMsg_DispatchOnDisconnect, | 425 IPC_MESSAGE_ROUTED2(ExtensionMsg_DispatchOnDisconnect, |
413 int /* port_id */, | 426 int /* port_id */, |
414 std::string /* error_message */) | 427 std::string /* error_message */) |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 DictionaryValue /* filter */, | 497 DictionaryValue /* filter */, |
485 bool /* lazy */) | 498 bool /* lazy */) |
486 | 499 |
487 // Notify the browser that an event has finished being dispatched. | 500 // Notify the browser that an event has finished being dispatched. |
488 IPC_MESSAGE_ROUTED0(ExtensionHostMsg_EventAck) | 501 IPC_MESSAGE_ROUTED0(ExtensionHostMsg_EventAck) |
489 | 502 |
490 // Open a channel to all listening contexts owned by the extension with | 503 // Open a channel to all listening contexts owned by the extension with |
491 // the given ID. This always returns a valid port ID which can be used for | 504 // the given ID. This always returns a valid port ID which can be used for |
492 // sending messages. If an error occurred, the opener will be notified | 505 // sending messages. If an error occurred, the opener will be notified |
493 // asynchronously. | 506 // asynchronously. |
494 IPC_SYNC_MESSAGE_CONTROL4_1(ExtensionHostMsg_OpenChannelToExtension, | 507 IPC_SYNC_MESSAGE_CONTROL3_1(ExtensionHostMsg_OpenChannelToExtension, |
495 int /* routing_id */, | 508 int /* routing_id */, |
496 std::string /* source_extension_id */, | 509 ExtensionMsg_ExternalConnectionInfo, |
497 std::string /* target_extension_id */, | |
498 std::string /* channel_name */, | 510 std::string /* channel_name */, |
499 int /* port_id */) | 511 int /* port_id */) |
500 | 512 |
501 IPC_SYNC_MESSAGE_CONTROL3_1(ExtensionHostMsg_OpenChannelToNativeApp, | 513 IPC_SYNC_MESSAGE_CONTROL3_1(ExtensionHostMsg_OpenChannelToNativeApp, |
502 int /* routing_id */, | 514 int /* routing_id */, |
503 std::string /* source_extension_id */, | 515 std::string /* source_extension_id */, |
504 std::string /* native_app_name */, | 516 std::string /* native_app_name */, |
505 int /* port_id */) | 517 int /* port_id */) |
506 | 518 |
507 // Get a port handle to the given tab. The handle can be used for sending | 519 // Get a port handle to the given tab. The handle can be used for sending |
(...skipping 16 matching lines...) Expand all Loading... |
524 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_CloseChannel, | 536 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_CloseChannel, |
525 int /* port_id */, | 537 int /* port_id */, |
526 std::string /* error_message */) | 538 std::string /* error_message */) |
527 | 539 |
528 // Used to get the extension message bundle. | 540 // Used to get the extension message bundle. |
529 IPC_SYNC_MESSAGE_CONTROL1_1(ExtensionHostMsg_GetMessageBundle, | 541 IPC_SYNC_MESSAGE_CONTROL1_1(ExtensionHostMsg_GetMessageBundle, |
530 std::string /* extension id */, | 542 std::string /* extension id */, |
531 SubstitutionMap /* message bundle */) | 543 SubstitutionMap /* message bundle */) |
532 | 544 |
533 // Sent from the renderer to the browser to return the script running result. | 545 // Sent from the renderer to the browser to return the script running result. |
534 IPC_MESSAGE_ROUTED5(ExtensionHostMsg_ExecuteCodeFinished, | 546 IPC_MESSAGE_ROUTED5( |
535 int /* request id */, | 547 ExtensionHostMsg_ExecuteCodeFinished, |
536 std::string /* error; empty implies success */, | 548 int /* request id */, |
537 int32 /* page_id the code executed on. | 549 std::string /* error; empty implies success */, |
538 May be -1 if unsuccessful */, | 550 int32 /* page_id the code executed on. May be -1 if unsuccessful */, |
539 GURL /* URL of the code executed on. | 551 GURL /* URL of the code executed on. May be empty if unsuccessful. */, |
540 May be empty if unsuccessful. */, | 552 ListValue /* result of the script */) |
541 ListValue /* result of the script */) | |
542 | 553 |
543 // Sent from the renderer to the browser to notify that content scripts are | 554 // Sent from the renderer to the browser to notify that content scripts are |
544 // running in the renderer that the IPC originated from. | 555 // running in the renderer that the IPC originated from. |
545 // Note that the page_id is for the parent (or more accurately the topmost) | 556 // Note that the page_id is for the parent (or more accurately the topmost) |
546 // frame (e.g. if executing in an iframe this is the page ID of the parent, | 557 // frame (e.g. if executing in an iframe this is the page ID of the parent, |
547 // unless the parent is an iframe... etc). | 558 // unless the parent is an iframe... etc). |
548 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_ContentScriptsExecuting, | 559 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_ContentScriptsExecuting, |
549 ExecutingScriptsMap, | 560 ExecutingScriptsMap, |
550 int32 /* page_id of the _topmost_ frame */, | 561 int32 /* page_id of the _topmost_ frame */, |
551 GURL /* url of the _topmost_ frame */) | 562 GURL /* url of the _topmost_ frame */) |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 // Notifies the browser process that a tab has started or stopped matching | 630 // Notifies the browser process that a tab has started or stopped matching |
620 // certain conditions. This message is sent in response to several events: | 631 // certain conditions. This message is sent in response to several events: |
621 // | 632 // |
622 // * ExtensionMsg_WatchPages was received, updating the set of conditions. | 633 // * ExtensionMsg_WatchPages was received, updating the set of conditions. |
623 // * A new page is loaded. This will be sent after ViewHostMsg_FrameNavigate. | 634 // * A new page is loaded. This will be sent after ViewHostMsg_FrameNavigate. |
624 // Currently this only fires for the main frame. | 635 // Currently this only fires for the main frame. |
625 // * Something changed on an existing frame causing the set of matching searches | 636 // * Something changed on an existing frame causing the set of matching searches |
626 // to change. | 637 // to change. |
627 IPC_MESSAGE_ROUTED1(ExtensionHostMsg_OnWatchedPageChange, | 638 IPC_MESSAGE_ROUTED1(ExtensionHostMsg_OnWatchedPageChange, |
628 std::vector<std::string> /* Matching CSS selectors */) | 639 std::vector<std::string> /* Matching CSS selectors */) |
OLD | NEW |