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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/shared_memory.h" | 11 #include "base/memory/shared_memory.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "content/public/common/common_param_traits.h" | 13 #include "content/public/common/common_param_traits.h" |
14 #include "content/public/common/socket_permission_request.h" | 14 #include "content/public/common/socket_permission_request.h" |
15 #include "extensions/common/api/messaging/message.h" | 15 #include "extensions/common/api/messaging/message.h" |
16 #include "extensions/common/draggable_region.h" | 16 #include "extensions/common/draggable_region.h" |
17 #include "extensions/common/extension.h" | 17 #include "extensions/common/extension.h" |
18 #include "extensions/common/extensions_client.h" | 18 #include "extensions/common/extensions_client.h" |
19 #include "extensions/common/host_id.h" | |
19 #include "extensions/common/permissions/media_galleries_permission_data.h" | 20 #include "extensions/common/permissions/media_galleries_permission_data.h" |
20 #include "extensions/common/permissions/permission_set.h" | 21 #include "extensions/common/permissions/permission_set.h" |
21 #include "extensions/common/permissions/socket_permission_data.h" | 22 #include "extensions/common/permissions/socket_permission_data.h" |
22 #include "extensions/common/permissions/usb_device_permission_data.h" | 23 #include "extensions/common/permissions/usb_device_permission_data.h" |
23 #include "extensions/common/stack_frame.h" | 24 #include "extensions/common/stack_frame.h" |
24 #include "extensions/common/url_pattern.h" | 25 #include "extensions/common/url_pattern.h" |
25 #include "extensions/common/url_pattern_set.h" | 26 #include "extensions/common/url_pattern_set.h" |
26 #include "extensions/common/user_script.h" | 27 #include "extensions/common/user_script.h" |
27 #include "extensions/common/view_type.h" | 28 #include "extensions/common/view_type.h" |
28 #include "ipc/ipc_message_macros.h" | 29 #include "ipc/ipc_message_macros.h" |
29 #include "ui/gfx/ipc/gfx_param_traits.h" | 30 #include "ui/gfx/ipc/gfx_param_traits.h" |
30 #include "url/gurl.h" | 31 #include "url/gurl.h" |
31 | 32 |
32 #define IPC_MESSAGE_START ExtensionMsgStart | 33 #define IPC_MESSAGE_START ExtensionMsgStart |
33 | 34 |
34 IPC_ENUM_TRAITS_MAX_VALUE(extensions::ViewType, extensions::VIEW_TYPE_LAST) | 35 IPC_ENUM_TRAITS_MAX_VALUE(extensions::ViewType, extensions::VIEW_TYPE_LAST) |
35 IPC_ENUM_TRAITS_MAX_VALUE(content::SocketPermissionRequest::OperationType, | 36 IPC_ENUM_TRAITS_MAX_VALUE(content::SocketPermissionRequest::OperationType, |
36 content::SocketPermissionRequest::OPERATION_TYPE_LAST) | 37 content::SocketPermissionRequest::OPERATION_TYPE_LAST) |
37 | 38 |
38 IPC_ENUM_TRAITS_MAX_VALUE(extensions::UserScript::InjectionType, | 39 IPC_ENUM_TRAITS_MAX_VALUE(extensions::UserScript::InjectionType, |
39 extensions::UserScript::INJECTION_TYPE_LAST) | 40 extensions::UserScript::INJECTION_TYPE_LAST) |
40 | 41 |
42 IPC_ENUM_TRAITS_MAX_VALUE(HostID::HostType, HostID::HOST_TYPE_LAST) | |
43 | |
41 // Parameters structure for ExtensionHostMsg_AddAPIActionToActivityLog and | 44 // Parameters structure for ExtensionHostMsg_AddAPIActionToActivityLog and |
42 // ExtensionHostMsg_AddEventToActivityLog. | 45 // ExtensionHostMsg_AddEventToActivityLog. |
43 IPC_STRUCT_BEGIN(ExtensionHostMsg_APIActionOrEvent_Params) | 46 IPC_STRUCT_BEGIN(ExtensionHostMsg_APIActionOrEvent_Params) |
44 // API name. | 47 // API name. |
45 IPC_STRUCT_MEMBER(std::string, api_call) | 48 IPC_STRUCT_MEMBER(std::string, api_call) |
46 | 49 |
47 // List of arguments. | 50 // List of arguments. |
48 IPC_STRUCT_MEMBER(base::ListValue, arguments) | 51 IPC_STRUCT_MEMBER(base::ListValue, arguments) |
49 | 52 |
50 // Extra logging information. | 53 // Extra logging information. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
99 | 102 |
100 // True if request is executed in response to an explicit user gesture. | 103 // True if request is executed in response to an explicit user gesture. |
101 IPC_STRUCT_MEMBER(bool, user_gesture) | 104 IPC_STRUCT_MEMBER(bool, user_gesture) |
102 IPC_STRUCT_END() | 105 IPC_STRUCT_END() |
103 | 106 |
104 // Allows an extension to execute code in a tab. | 107 // Allows an extension to execute code in a tab. |
105 IPC_STRUCT_BEGIN(ExtensionMsg_ExecuteCode_Params) | 108 IPC_STRUCT_BEGIN(ExtensionMsg_ExecuteCode_Params) |
106 // The extension API request id, for responding. | 109 // The extension API request id, for responding. |
107 IPC_STRUCT_MEMBER(int, request_id) | 110 IPC_STRUCT_MEMBER(int, request_id) |
108 | 111 |
109 // The ID of the requesting extension. To know which isolated world to | 112 // The ID of the requesting injection host. |
110 // execute the code inside of. | 113 IPC_STRUCT_MEMBER(HostID, host_id) |
Devlin
2015/03/09 16:04:42
I'm getting more and more nervous about the size o
Xi Han
2015/03/09 17:59:56
Acknowledged.
| |
111 IPC_STRUCT_MEMBER(std::string, extension_id) | |
112 | 114 |
113 // Whether the code is JavaScript or CSS. | 115 // Whether the code is JavaScript or CSS. |
114 IPC_STRUCT_MEMBER(bool, is_javascript) | 116 IPC_STRUCT_MEMBER(bool, is_javascript) |
115 | 117 |
116 // String of code to execute. | 118 // String of code to execute. |
117 IPC_STRUCT_MEMBER(std::string, code) | 119 IPC_STRUCT_MEMBER(std::string, code) |
118 | 120 |
119 // The webview guest source who calls to execute code. | 121 // The webview guest source who calls to execute code. |
120 IPC_STRUCT_MEMBER(GURL, webview_src) | 122 IPC_STRUCT_MEMBER(GURL, webview_src) |
121 | 123 |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
331 | 333 |
332 template <> | 334 template <> |
333 struct ParamTraits<extensions::ManifestPermissionSet> { | 335 struct ParamTraits<extensions::ManifestPermissionSet> { |
334 typedef extensions::ManifestPermissionSet param_type; | 336 typedef extensions::ManifestPermissionSet param_type; |
335 static void Write(Message* m, const param_type& p); | 337 static void Write(Message* m, const param_type& p); |
336 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 338 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
337 static void Log(const param_type& p, std::string* l); | 339 static void Log(const param_type& p, std::string* l); |
338 }; | 340 }; |
339 | 341 |
340 template <> | 342 template <> |
343 struct ParamTraits<HostID> { | |
344 typedef HostID param_type; | |
345 static void Write(Message* m, const param_type& p); | |
346 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | |
347 static void Log(const param_type& p, std::string* l); | |
348 }; | |
349 | |
350 template <> | |
341 struct ParamTraits<ExtensionMsg_PermissionSetStruct> { | 351 struct ParamTraits<ExtensionMsg_PermissionSetStruct> { |
342 typedef ExtensionMsg_PermissionSetStruct param_type; | 352 typedef ExtensionMsg_PermissionSetStruct param_type; |
343 static void Write(Message* m, const param_type& p); | 353 static void Write(Message* m, const param_type& p); |
344 static bool Read(const Message* m, PickleIterator* iter, param_type* p); | 354 static bool Read(const Message* m, PickleIterator* iter, param_type* p); |
345 static void Log(const param_type& p, std::string* l); | 355 static void Log(const param_type& p, std::string* l); |
346 }; | 356 }; |
347 | 357 |
348 template <> | 358 template <> |
349 struct ParamTraits<ExtensionMsg_Loaded_Params> { | 359 struct ParamTraits<ExtensionMsg_Loaded_Params> { |
350 typedef ExtensionMsg_Loaded_Params param_type; | 360 typedef ExtensionMsg_Loaded_Params param_type; |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
780 int /* acc_obj_id */, | 790 int /* acc_obj_id */, |
781 base::string16 /* selector */) | 791 base::string16 /* selector */) |
782 | 792 |
783 // Result of a query selector request. | 793 // Result of a query selector request. |
784 // result_acc_obj_id is the accessibility tree ID of the result element; 0 | 794 // result_acc_obj_id is the accessibility tree ID of the result element; 0 |
785 // indicates no result. | 795 // indicates no result. |
786 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_AutomationQuerySelector_Result, | 796 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_AutomationQuerySelector_Result, |
787 int /* request_id */, | 797 int /* request_id */, |
788 ExtensionHostMsg_AutomationQuerySelector_Error /* error */, | 798 ExtensionHostMsg_AutomationQuerySelector_Error /* error */, |
789 int /* result_acc_obj_id */) | 799 int /* result_acc_obj_id */) |
OLD | NEW |