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 // 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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/memory/shared_memory.h" | 13 #include "base/memory/shared_memory.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "components/version_info/version_info.h" | 15 #include "components/version_info/version_info.h" |
16 #include "content/public/common/common_param_traits.h" | 16 #include "content/public/common/common_param_traits.h" |
17 #include "content/public/common/socket_permission_request.h" | 17 #include "content/public/common/socket_permission_request.h" |
18 #include "extensions/common/api/messaging/message.h" | 18 #include "extensions/common/api/messaging/message.h" |
19 #include "extensions/common/draggable_region.h" | 19 #include "extensions/common/draggable_region.h" |
20 #include "extensions/common/extension.h" | 20 #include "extensions/common/extension.h" |
21 #include "extensions/common/extensions_client.h" | 21 #include "extensions/common/extensions_client.h" |
| 22 #include "extensions/common/features/feature_session_type.h" |
22 #include "extensions/common/host_id.h" | 23 #include "extensions/common/host_id.h" |
23 #include "extensions/common/permissions/media_galleries_permission_data.h" | 24 #include "extensions/common/permissions/media_galleries_permission_data.h" |
24 #include "extensions/common/permissions/permission_set.h" | 25 #include "extensions/common/permissions/permission_set.h" |
25 #include "extensions/common/permissions/socket_permission_data.h" | 26 #include "extensions/common/permissions/socket_permission_data.h" |
26 #include "extensions/common/permissions/usb_device_permission_data.h" | 27 #include "extensions/common/permissions/usb_device_permission_data.h" |
27 #include "extensions/common/stack_frame.h" | 28 #include "extensions/common/stack_frame.h" |
28 #include "extensions/common/url_pattern.h" | 29 #include "extensions/common/url_pattern.h" |
29 #include "extensions/common/url_pattern_set.h" | 30 #include "extensions/common/url_pattern_set.h" |
30 #include "extensions/common/user_script.h" | 31 #include "extensions/common/user_script.h" |
31 #include "extensions/common/view_type.h" | 32 #include "extensions/common/view_type.h" |
32 #include "ipc/ipc_message_macros.h" | 33 #include "ipc/ipc_message_macros.h" |
33 #include "url/gurl.h" | 34 #include "url/gurl.h" |
34 | 35 |
35 #define IPC_MESSAGE_START ExtensionMsgStart | 36 #define IPC_MESSAGE_START ExtensionMsgStart |
36 | 37 |
37 IPC_ENUM_TRAITS_MAX_VALUE(extensions::ViewType, extensions::VIEW_TYPE_LAST) | 38 IPC_ENUM_TRAITS_MAX_VALUE(extensions::ViewType, extensions::VIEW_TYPE_LAST) |
38 IPC_ENUM_TRAITS_MAX_VALUE(content::SocketPermissionRequest::OperationType, | 39 IPC_ENUM_TRAITS_MAX_VALUE(content::SocketPermissionRequest::OperationType, |
39 content::SocketPermissionRequest::OPERATION_TYPE_LAST) | 40 content::SocketPermissionRequest::OPERATION_TYPE_LAST) |
40 | 41 |
41 IPC_ENUM_TRAITS_MAX_VALUE(extensions::UserScript::InjectionType, | 42 IPC_ENUM_TRAITS_MAX_VALUE(extensions::UserScript::InjectionType, |
42 extensions::UserScript::INJECTION_TYPE_LAST) | 43 extensions::UserScript::INJECTION_TYPE_LAST) |
43 | 44 |
44 IPC_ENUM_TRAITS_MAX_VALUE(extensions::UserScript::RunLocation, | 45 IPC_ENUM_TRAITS_MAX_VALUE(extensions::UserScript::RunLocation, |
45 extensions::UserScript::RUN_LOCATION_LAST - 1) | 46 extensions::UserScript::RUN_LOCATION_LAST - 1) |
46 | 47 |
47 IPC_ENUM_TRAITS_MAX_VALUE(HostID::HostType, HostID::HOST_TYPE_LAST) | 48 IPC_ENUM_TRAITS_MAX_VALUE(HostID::HostType, HostID::HOST_TYPE_LAST) |
48 IPC_ENUM_TRAITS_MAX_VALUE(version_info::Channel, version_info::Channel::STABLE) | 49 IPC_ENUM_TRAITS_MAX_VALUE(version_info::Channel, version_info::Channel::STABLE) |
| 50 IPC_ENUM_TRAITS_MAX_VALUE(extensions::FeatureSessionType, |
| 51 extensions::FeatureSessionType::LAST) |
49 | 52 |
50 // Parameters structure for ExtensionHostMsg_AddAPIActionToActivityLog and | 53 // Parameters structure for ExtensionHostMsg_AddAPIActionToActivityLog and |
51 // ExtensionHostMsg_AddEventToActivityLog. | 54 // ExtensionHostMsg_AddEventToActivityLog. |
52 IPC_STRUCT_BEGIN(ExtensionHostMsg_APIActionOrEvent_Params) | 55 IPC_STRUCT_BEGIN(ExtensionHostMsg_APIActionOrEvent_Params) |
53 // API name. | 56 // API name. |
54 IPC_STRUCT_MEMBER(std::string, api_call) | 57 IPC_STRUCT_MEMBER(std::string, api_call) |
55 | 58 |
56 // List of arguments. | 59 // List of arguments. |
57 IPC_STRUCT_MEMBER(base::ListValue, arguments) | 60 IPC_STRUCT_MEMBER(base::ListValue, arguments) |
58 | 61 |
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 IPC_MESSAGE_ROUTED3(ExtensionMsg_DeliverMessage, | 586 IPC_MESSAGE_ROUTED3(ExtensionMsg_DeliverMessage, |
584 int /* target_port_id */, | 587 int /* target_port_id */, |
585 int /* source_tab_id */, | 588 int /* source_tab_id */, |
586 extensions::Message) | 589 extensions::Message) |
587 | 590 |
588 // Dispatch the Port.onDisconnect event for message channels. | 591 // Dispatch the Port.onDisconnect event for message channels. |
589 IPC_MESSAGE_ROUTED2(ExtensionMsg_DispatchOnDisconnect, | 592 IPC_MESSAGE_ROUTED2(ExtensionMsg_DispatchOnDisconnect, |
590 int /* port_id */, | 593 int /* port_id */, |
591 std::string /* error_message */) | 594 std::string /* error_message */) |
592 | 595 |
593 // Informs the renderer what channel (dev, beta, stable, etc) is running. | 596 // Informs the renderer what channel (dev, beta, stable, etc) and user session |
594 IPC_MESSAGE_CONTROL1(ExtensionMsg_SetChannel, | 597 // type is running. |
595 version_info::Channel /* channel */) | 598 IPC_MESSAGE_CONTROL2(ExtensionMsg_SetSessionInfo, |
| 599 version_info::Channel /* channel */, |
| 600 extensions::FeatureSessionType /* session_type */) |
596 | 601 |
597 // Notify the renderer that its window has closed. | 602 // Notify the renderer that its window has closed. |
598 IPC_MESSAGE_ROUTED0(ExtensionMsg_AppWindowClosed) | 603 IPC_MESSAGE_ROUTED0(ExtensionMsg_AppWindowClosed) |
599 | 604 |
600 // Notify the renderer that an extension wants notifications when certain | 605 // Notify the renderer that an extension wants notifications when certain |
601 // searches match the active page. This message replaces the old set of | 606 // searches match the active page. This message replaces the old set of |
602 // searches, and triggers ExtensionHostMsg_OnWatchedPageChange messages from | 607 // searches, and triggers ExtensionHostMsg_OnWatchedPageChange messages from |
603 // each tab to keep the browser updated about changes. | 608 // each tab to keep the browser updated about changes. |
604 IPC_MESSAGE_CONTROL1(ExtensionMsg_WatchPages, | 609 IPC_MESSAGE_CONTROL1(ExtensionMsg_WatchPages, |
605 std::vector<std::string> /* CSS selectors */) | 610 std::vector<std::string> /* CSS selectors */) |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 | 875 |
871 // The browser sends this message in response to all service worker extension | 876 // The browser sends this message in response to all service worker extension |
872 // api calls. The response data (if any) is one of the base::Value subclasses, | 877 // api calls. The response data (if any) is one of the base::Value subclasses, |
873 // wrapped as the first element in a ListValue. | 878 // wrapped as the first element in a ListValue. |
874 IPC_MESSAGE_CONTROL5(ExtensionMsg_ResponseWorker, | 879 IPC_MESSAGE_CONTROL5(ExtensionMsg_ResponseWorker, |
875 int /* thread_id */, | 880 int /* thread_id */, |
876 int /* request_id */, | 881 int /* request_id */, |
877 bool /* success */, | 882 bool /* success */, |
878 base::ListValue /* response wrapper (see comment above) */, | 883 base::ListValue /* response wrapper (see comment above) */, |
879 std::string /* error */) | 884 std::string /* error */) |
OLD | NEW |