Introduce AndroidMetricsProvider class.
[chromium-blink-merge.git] / extensions / common / extension_messages.h
blob9bb15abaa89535afc5ec304b2f0804e2ff4b6fd9
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
3 // found in the LICENSE file.
5 // IPC messages for extensions.
6 // Multiply-included message file, hence no include guard.
8 #include <string>
9 #include <vector>
11 #include "base/memory/shared_memory.h"
12 #include "base/values.h"
13 #include "content/public/common/common_param_traits.h"
14 #include "content/public/common/socket_permission_request.h"
15 #include "extensions/common/api/messaging/message.h"
16 #include "extensions/common/draggable_region.h"
17 #include "extensions/common/extension.h"
18 #include "extensions/common/extensions_client.h"
19 #include "extensions/common/permissions/media_galleries_permission_data.h"
20 #include "extensions/common/permissions/permission_set.h"
21 #include "extensions/common/permissions/socket_permission_data.h"
22 #include "extensions/common/permissions/usb_device_permission_data.h"
23 #include "extensions/common/url_pattern.h"
24 #include "extensions/common/url_pattern_set.h"
25 #include "extensions/common/view_type.h"
26 #include "ipc/ipc_message_macros.h"
27 #include "url/gurl.h"
29 #define IPC_MESSAGE_START ExtensionMsgStart
31 IPC_ENUM_TRAITS_MAX_VALUE(extensions::ViewType, extensions::VIEW_TYPE_LAST)
32 IPC_ENUM_TRAITS_MAX_VALUE(content::SocketPermissionRequest::OperationType,
33 content::SocketPermissionRequest::OPERATION_TYPE_LAST)
35 // Parameters structure for ExtensionHostMsg_AddAPIActionToActivityLog and
36 // ExtensionHostMsg_AddEventToActivityLog.
37 IPC_STRUCT_BEGIN(ExtensionHostMsg_APIActionOrEvent_Params)
38 // API name.
39 IPC_STRUCT_MEMBER(std::string, api_call)
41 // List of arguments.
42 IPC_STRUCT_MEMBER(base::ListValue, arguments)
44 // Extra logging information.
45 IPC_STRUCT_MEMBER(std::string, extra)
46 IPC_STRUCT_END()
48 // Parameters structure for ExtensionHostMsg_AddDOMActionToActivityLog.
49 IPC_STRUCT_BEGIN(ExtensionHostMsg_DOMAction_Params)
50 // URL of the page.
51 IPC_STRUCT_MEMBER(GURL, url)
53 // Title of the page.
54 IPC_STRUCT_MEMBER(base::string16, url_title)
56 // API name.
57 IPC_STRUCT_MEMBER(std::string, api_call)
59 // List of arguments.
60 IPC_STRUCT_MEMBER(base::ListValue, arguments)
62 // Type of DOM API call.
63 IPC_STRUCT_MEMBER(int, call_type)
64 IPC_STRUCT_END()
66 // Parameters structure for ExtensionHostMsg_Request.
67 IPC_STRUCT_BEGIN(ExtensionHostMsg_Request_Params)
68 // Message name.
69 IPC_STRUCT_MEMBER(std::string, name)
71 // List of message arguments.
72 IPC_STRUCT_MEMBER(base::ListValue, arguments)
74 // Extension ID this request was sent from. This can be empty, in the case
75 // where we expose APIs to normal web pages using the extension function
76 // system.
77 IPC_STRUCT_MEMBER(std::string, extension_id)
79 // URL of the frame the request was sent from. This isn't necessarily an
80 // extension url. Extension requests can also originate from content scripts,
81 // in which case extension_id will indicate the ID of the associated
82 // extension. Or, they can originate from hosted apps or normal web pages.
83 IPC_STRUCT_MEMBER(GURL, source_url)
85 // The id of the tab that sent this request, or -1 if there is no source tab.
86 IPC_STRUCT_MEMBER(int, source_tab_id)
88 // Unique request id to match requests and responses.
89 IPC_STRUCT_MEMBER(int, request_id)
91 // True if request has a callback specified.
92 IPC_STRUCT_MEMBER(bool, has_callback)
94 // True if request is executed in response to an explicit user gesture.
95 IPC_STRUCT_MEMBER(bool, user_gesture)
96 IPC_STRUCT_END()
98 // Allows an extension to execute code in a tab.
99 IPC_STRUCT_BEGIN(ExtensionMsg_ExecuteCode_Params)
100 // The extension API request id, for responding.
101 IPC_STRUCT_MEMBER(int, request_id)
103 // The ID of the requesting extension. To know which isolated world to
104 // execute the code inside of.
105 IPC_STRUCT_MEMBER(std::string, extension_id)
107 // Whether the code is JavaScript or CSS.
108 IPC_STRUCT_MEMBER(bool, is_javascript)
110 // String of code to execute.
111 IPC_STRUCT_MEMBER(std::string, code)
113 // The webview guest source who calls to execute code.
114 IPC_STRUCT_MEMBER(GURL, webview_src)
116 // Whether to inject into all frames, or only the root frame.
117 IPC_STRUCT_MEMBER(bool, all_frames)
119 // Whether to inject into about:blank (sub)frames.
120 IPC_STRUCT_MEMBER(bool, match_about_blank)
122 // When to inject the code.
123 IPC_STRUCT_MEMBER(int, run_at)
125 // Whether to execute code in the main world (as opposed to an isolated
126 // world).
127 IPC_STRUCT_MEMBER(bool, in_main_world)
129 // Whether the request is coming from a <webview>.
130 IPC_STRUCT_MEMBER(bool, is_web_view)
132 // Whether the caller is interested in the result value. Manifest-declared
133 // content scripts and executeScript() calls without a response callback
134 // are examples of when this will be false.
135 IPC_STRUCT_MEMBER(bool, wants_result)
137 // The URL of the file that was injected, if any.
138 IPC_STRUCT_MEMBER(GURL, file_url)
140 // Whether the code to be executed should be associated with a user gesture.
141 IPC_STRUCT_MEMBER(bool, user_gesture)
142 IPC_STRUCT_END()
144 // Struct containing the data for external connections to extensions. Used to
145 // handle the IPCs initiated by both connect() and onConnect().
146 IPC_STRUCT_BEGIN(ExtensionMsg_ExternalConnectionInfo)
147 // The ID of the extension that is the target of the request.
148 IPC_STRUCT_MEMBER(std::string, target_id)
150 // The ID of the extension that initiated the request. May be empty if it
151 // wasn't initiated by an extension.
152 IPC_STRUCT_MEMBER(std::string, source_id)
154 // The URL of the frame that initiated the request.
155 IPC_STRUCT_MEMBER(GURL, source_url)
156 IPC_STRUCT_END()
158 // Parameters structure for ExtensionMsg_UpdatePermissions.
159 IPC_STRUCT_BEGIN(ExtensionMsg_UpdatePermissions_Params)
160 IPC_STRUCT_MEMBER(int /* UpdateExtensionPermissionsInfo::REASON */, reason_id)
161 IPC_STRUCT_MEMBER(std::string, extension_id)
162 IPC_STRUCT_MEMBER(extensions::APIPermissionSet, apis)
163 IPC_STRUCT_MEMBER(extensions::ManifestPermissionSet, manifest_permissions)
164 IPC_STRUCT_MEMBER(extensions::URLPatternSet, explicit_hosts)
165 IPC_STRUCT_MEMBER(extensions::URLPatternSet, scriptable_hosts)
166 IPC_STRUCT_END()
168 IPC_STRUCT_TRAITS_BEGIN(extensions::DraggableRegion)
169 IPC_STRUCT_TRAITS_MEMBER(draggable)
170 IPC_STRUCT_TRAITS_MEMBER(bounds)
171 IPC_STRUCT_TRAITS_END()
173 IPC_STRUCT_TRAITS_BEGIN(content::SocketPermissionRequest)
174 IPC_STRUCT_TRAITS_MEMBER(type)
175 IPC_STRUCT_TRAITS_MEMBER(host)
176 IPC_STRUCT_TRAITS_MEMBER(port)
177 IPC_STRUCT_TRAITS_END()
179 IPC_STRUCT_TRAITS_BEGIN(extensions::SocketPermissionEntry)
180 IPC_STRUCT_TRAITS_MEMBER(pattern_)
181 IPC_STRUCT_TRAITS_MEMBER(match_subdomains_)
182 IPC_STRUCT_TRAITS_END()
184 IPC_STRUCT_TRAITS_BEGIN(extensions::SocketPermissionData)
185 IPC_STRUCT_TRAITS_MEMBER(entry())
186 IPC_STRUCT_TRAITS_END()
188 IPC_STRUCT_TRAITS_BEGIN(extensions::UsbDevicePermissionData)
189 IPC_STRUCT_TRAITS_MEMBER(vendor_id())
190 IPC_STRUCT_TRAITS_MEMBER(product_id())
191 IPC_STRUCT_TRAITS_END()
193 IPC_STRUCT_TRAITS_BEGIN(extensions::MediaGalleriesPermissionData)
194 IPC_STRUCT_TRAITS_MEMBER(permission())
195 IPC_STRUCT_TRAITS_END()
197 IPC_STRUCT_TRAITS_BEGIN(extensions::Message)
198 IPC_STRUCT_TRAITS_MEMBER(data)
199 IPC_STRUCT_TRAITS_MEMBER(user_gesture)
200 IPC_STRUCT_TRAITS_END()
202 // Singly-included section for custom IPC traits.
203 #ifndef EXTENSIONS_COMMON_EXTENSION_MESSAGES_H_
204 #define EXTENSIONS_COMMON_EXTENSION_MESSAGES_H_
206 // IPC_MESSAGE macros choke on extra , in the std::map, when expanding. We need
207 // to typedef it to avoid that.
208 // Substitution map for l10n messages.
209 typedef std::map<std::string, std::string> SubstitutionMap;
211 // Map of extensions IDs to the executing script paths.
212 typedef std::map<std::string, std::set<std::string> > ExecutingScriptsMap;
214 struct ExtensionMsg_Loaded_Params {
215 ExtensionMsg_Loaded_Params();
216 ~ExtensionMsg_Loaded_Params();
217 explicit ExtensionMsg_Loaded_Params(const extensions::Extension* extension);
219 // Creates a new extension from the data in this object.
220 scoped_refptr<extensions::Extension> ConvertToExtension(
221 std::string* error) const;
223 // The subset of the extension manifest data we send to renderers.
224 linked_ptr<base::DictionaryValue> manifest;
226 // The location the extension was installed from.
227 extensions::Manifest::Location location;
229 // The path the extension was loaded from. This is used in the renderer only
230 // to generate the extension ID for extensions that are loaded unpacked.
231 base::FilePath path;
233 // The extension's active permissions.
234 extensions::APIPermissionSet apis;
235 extensions::ManifestPermissionSet manifest_permissions;
236 extensions::URLPatternSet explicit_hosts;
237 extensions::URLPatternSet scriptable_hosts;
239 // We keep this separate so that it can be used in logging.
240 std::string id;
242 // Send creation flags so extension is initialized identically.
243 int creation_flags;
246 namespace IPC {
248 template <>
249 struct ParamTraits<URLPattern> {
250 typedef URLPattern param_type;
251 static void Write(Message* m, const param_type& p);
252 static bool Read(const Message* m, PickleIterator* iter, param_type* p);
253 static void Log(const param_type& p, std::string* l);
256 template <>
257 struct ParamTraits<extensions::URLPatternSet> {
258 typedef extensions::URLPatternSet param_type;
259 static void Write(Message* m, const param_type& p);
260 static bool Read(const Message* m, PickleIterator* iter, param_type* p);
261 static void Log(const param_type& p, std::string* l);
264 template <>
265 struct ParamTraits<extensions::APIPermission::ID> {
266 typedef extensions::APIPermission::ID param_type;
267 static void Write(Message* m, const param_type& p);
268 static bool Read(const Message* m, PickleIterator* iter, param_type* p);
269 static void Log(const param_type& p, std::string* l);
272 template <>
273 struct ParamTraits<extensions::APIPermissionSet> {
274 typedef extensions::APIPermissionSet param_type;
275 static void Write(Message* m, const param_type& p);
276 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
277 static void Log(const param_type& p, std::string* l);
280 template <>
281 struct ParamTraits<extensions::ManifestPermissionSet> {
282 typedef extensions::ManifestPermissionSet param_type;
283 static void Write(Message* m, const param_type& p);
284 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
285 static void Log(const param_type& p, std::string* l);
288 template <>
289 struct ParamTraits<ExtensionMsg_Loaded_Params> {
290 typedef ExtensionMsg_Loaded_Params param_type;
291 static void Write(Message* m, const param_type& p);
292 static bool Read(const Message* m, PickleIterator* iter, param_type* p);
293 static void Log(const param_type& p, std::string* l);
296 } // namespace IPC
298 #endif // EXTENSIONS_COMMON_EXTENSION_MESSAGES_H_
300 // Messages sent from the browser to the renderer.
302 // The browser sends this message in response to all extension api calls. The
303 // response data (if any) is one of the base::Value subclasses, wrapped as the
304 // first element in a ListValue.
305 IPC_MESSAGE_ROUTED4(ExtensionMsg_Response,
306 int /* request_id */,
307 bool /* success */,
308 base::ListValue /* response wrapper (see comment above) */,
309 std::string /* error */)
311 // This message is optionally routed. If used as a control message, it will
312 // call a javascript function |function_name| from module |module_name| in
313 // every registered context in the target process. If routed, it will be
314 // restricted to the contexts that are part of the target RenderView.
316 // If |extension_id| is non-empty, the function will be invoked only in
317 // contexts owned by the extension. |args| is a list of primitive Value types
318 // that are passed to the function.
319 IPC_MESSAGE_ROUTED5(ExtensionMsg_MessageInvoke,
320 std::string /* extension_id */,
321 std::string /* module_name */,
322 std::string /* function_name */,
323 base::ListValue /* args */,
324 bool /* delivered as part of a user gesture */)
326 // Tell the renderer process all known extension function names.
327 IPC_MESSAGE_CONTROL1(ExtensionMsg_SetFunctionNames,
328 std::vector<std::string>)
330 // Tell the renderer process the platforms system font.
331 IPC_MESSAGE_CONTROL2(ExtensionMsg_SetSystemFont,
332 std::string /* font_family */,
333 std::string /* font_size */)
335 // Marks an extension as 'active' in an extension process. 'Active' extensions
336 // have more privileges than other extension content that might end up running
337 // in the process (e.g. because of iframes or content scripts).
338 IPC_MESSAGE_CONTROL1(ExtensionMsg_ActivateExtension,
339 std::string /* extension_id */)
341 // Notifies the renderer that extensions were loaded in the browser.
342 IPC_MESSAGE_CONTROL1(ExtensionMsg_Loaded,
343 std::vector<ExtensionMsg_Loaded_Params>)
345 // Notifies the renderer that an extension was unloaded in the browser.
346 IPC_MESSAGE_CONTROL1(ExtensionMsg_Unloaded,
347 std::string)
349 // Updates the scripting whitelist for extensions in the render process. This is
350 // only used for testing.
351 IPC_MESSAGE_CONTROL1(ExtensionMsg_SetScriptingWhitelist,
352 // extension ids
353 extensions::ExtensionsClient::ScriptingWhitelist)
355 // Notification that renderer should run some JavaScript code.
356 IPC_MESSAGE_ROUTED1(ExtensionMsg_ExecuteCode,
357 ExtensionMsg_ExecuteCode_Params)
359 // Notification that the user scripts have been updated. It has one
360 // SharedMemoryHandle argument consisting of the pickled script data. This
361 // handle is valid in the context of the renderer.
362 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdateUserScripts,
363 base::SharedMemoryHandle)
365 // Tell the render view which browser window it's being attached to.
366 IPC_MESSAGE_ROUTED1(ExtensionMsg_UpdateBrowserWindowId,
367 int /* id of browser window */)
369 // Tell the render view what its tab ID is.
370 IPC_MESSAGE_ROUTED1(ExtensionMsg_SetTabId,
371 int /* id of tab */)
373 // Tell the renderer to update an extension's permission set.
374 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdatePermissions,
375 ExtensionMsg_UpdatePermissions_Params)
377 // Tell the renderer about new tab-specific permissions for an extension.
378 IPC_MESSAGE_CONTROL4(ExtensionMsg_UpdateTabSpecificPermissions,
379 int32 /* page_id (only relevant for the target tab) */,
380 int /* tab_id */,
381 std::string /* extension_id */,
382 extensions::URLPatternSet /* hosts */)
384 // Tell the renderer to clear tab-specific permissions for some extensions.
385 IPC_MESSAGE_CONTROL2(ExtensionMsg_ClearTabSpecificPermissions,
386 int /* tab_id */,
387 std::vector<std::string> /* extension_ids */)
389 // Tell the renderer which type this view is.
390 IPC_MESSAGE_ROUTED1(ExtensionMsg_NotifyRenderViewType,
391 extensions::ViewType /* view_type */)
393 // Deliver a message sent with ExtensionHostMsg_PostMessage.
394 IPC_MESSAGE_CONTROL3(ExtensionMsg_UsingWebRequestAPI,
395 bool /* adblock */,
396 bool /* adblock_plus */,
397 bool /* other_webrequest */)
399 // Ask the lazy background page if it is ready to be suspended. This is sent
400 // when the page is considered idle. The renderer will reply with the same
401 // sequence_id so that we can tell which message it is responding to.
402 IPC_MESSAGE_CONTROL2(ExtensionMsg_ShouldSuspend,
403 std::string /* extension_id */,
404 int /* sequence_id */)
406 // If we complete a round of ShouldSuspend->ShouldSuspendAck messages without
407 // the lazy background page becoming active again, we are ready to unload. This
408 // message tells the page to dispatch the suspend event.
409 IPC_MESSAGE_CONTROL1(ExtensionMsg_Suspend,
410 std::string /* extension_id */)
412 // The browser changed its mind about suspending this extension.
413 IPC_MESSAGE_CONTROL1(ExtensionMsg_CancelSuspend,
414 std::string /* extension_id */)
416 // Response to the renderer for ExtensionHostMsg_GetAppInstallState.
417 IPC_MESSAGE_ROUTED2(ExtensionMsg_GetAppInstallStateResponse,
418 std::string /* state */,
419 int32 /* callback_id */)
421 // Dispatch the Port.onConnect event for message channels.
422 IPC_MESSAGE_ROUTED5(ExtensionMsg_DispatchOnConnect,
423 int /* target_port_id */,
424 std::string /* channel_name */,
425 base::DictionaryValue /* source_tab */,
426 ExtensionMsg_ExternalConnectionInfo,
427 std::string /* tls_channel_id */)
429 // Deliver a message sent with ExtensionHostMsg_PostMessage.
430 IPC_MESSAGE_ROUTED2(ExtensionMsg_DeliverMessage,
431 int /* target_port_id */,
432 extensions::Message)
434 // Dispatch the Port.onDisconnect event for message channels.
435 IPC_MESSAGE_ROUTED2(ExtensionMsg_DispatchOnDisconnect,
436 int /* port_id */,
437 std::string /* error_message */)
439 // Informs the renderer what channel (dev, beta, stable, etc) is running.
440 IPC_MESSAGE_CONTROL1(ExtensionMsg_SetChannel,
441 int /* channel */)
443 // Adds a logging message to the renderer's root frame DevTools console.
444 IPC_MESSAGE_ROUTED2(ExtensionMsg_AddMessageToConsole,
445 content::ConsoleMessageLevel /* level */,
446 std::string /* message */)
448 // Notify the renderer that its window has closed.
449 IPC_MESSAGE_ROUTED0(ExtensionMsg_AppWindowClosed)
451 // Notify the renderer that an extension wants notifications when certain
452 // searches match the active page. This message replaces the old set of
453 // searches, and triggers ExtensionHostMsg_OnWatchedPageChange messages from
454 // each tab to keep the browser updated about changes.
455 IPC_MESSAGE_CONTROL1(ExtensionMsg_WatchPages,
456 std::vector<std::string> /* CSS selectors */)
458 // Messages sent from the renderer to the browser.
460 // A renderer sends this message when an extension process starts an API
461 // request. The browser will always respond with a ExtensionMsg_Response.
462 IPC_MESSAGE_ROUTED1(ExtensionHostMsg_Request,
463 ExtensionHostMsg_Request_Params)
465 // A renderer sends this message when an extension process starts an API
466 // request. The browser will always respond with a ExtensionMsg_Response.
467 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_RequestForIOThread,
468 int /* routing_id */,
469 ExtensionHostMsg_Request_Params)
471 // Notify the browser that the given extension added a listener to an event.
472 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_AddListener,
473 std::string /* extension_id */,
474 std::string /* name */)
476 // Notify the browser that the given extension removed a listener from an
477 // event.
478 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_RemoveListener,
479 std::string /* extension_id */,
480 std::string /* name */)
482 // Notify the browser that the given extension added a listener to an event from
483 // a lazy background page.
484 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_AddLazyListener,
485 std::string /* extension_id */,
486 std::string /* name */)
488 // Notify the browser that the given extension is no longer interested in
489 // receiving the given event from a lazy background page.
490 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_RemoveLazyListener,
491 std::string /* extension_id */,
492 std::string /* name */)
494 // Notify the browser that the given extension added a listener to instances of
495 // the named event that satisfy the filter.
496 IPC_MESSAGE_CONTROL4(ExtensionHostMsg_AddFilteredListener,
497 std::string /* extension_id */,
498 std::string /* name */,
499 base::DictionaryValue /* filter */,
500 bool /* lazy */)
502 // Notify the browser that the given extension is no longer interested in
503 // instances of the named event that satisfy the filter.
504 IPC_MESSAGE_CONTROL4(ExtensionHostMsg_RemoveFilteredListener,
505 std::string /* extension_id */,
506 std::string /* name */,
507 base::DictionaryValue /* filter */,
508 bool /* lazy */)
510 // Notify the browser that an event has finished being dispatched.
511 IPC_MESSAGE_ROUTED0(ExtensionHostMsg_EventAck)
513 // Open a channel to all listening contexts owned by the extension with
514 // the given ID. This always returns a valid port ID which can be used for
515 // sending messages. If an error occurred, the opener will be notified
516 // asynchronously.
517 IPC_SYNC_MESSAGE_CONTROL4_1(ExtensionHostMsg_OpenChannelToExtension,
518 int /* routing_id */,
519 ExtensionMsg_ExternalConnectionInfo,
520 std::string /* channel_name */,
521 bool /* include_tls_channel_id */,
522 int /* port_id */)
524 IPC_SYNC_MESSAGE_CONTROL3_1(ExtensionHostMsg_OpenChannelToNativeApp,
525 int /* routing_id */,
526 std::string /* source_extension_id */,
527 std::string /* native_app_name */,
528 int /* port_id */)
530 // Get a port handle to the given tab. The handle can be used for sending
531 // messages to the extension.
532 IPC_SYNC_MESSAGE_CONTROL4_1(ExtensionHostMsg_OpenChannelToTab,
533 int /* routing_id */,
534 int /* tab_id */,
535 std::string /* extension_id */,
536 std::string /* channel_name */,
537 int /* port_id */)
539 // Send a message to an extension process. The handle is the value returned
540 // by ViewHostMsg_OpenChannelTo*.
541 IPC_MESSAGE_ROUTED2(ExtensionHostMsg_PostMessage,
542 int /* port_id */,
543 extensions::Message)
545 // Send a message to an extension process. The handle is the value returned
546 // by ViewHostMsg_OpenChannelTo*.
547 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_CloseChannel,
548 int /* port_id */,
549 std::string /* error_message */)
551 // Used to get the extension message bundle.
552 IPC_SYNC_MESSAGE_CONTROL1_1(ExtensionHostMsg_GetMessageBundle,
553 std::string /* extension id */,
554 SubstitutionMap /* message bundle */)
556 // Sent from the renderer to the browser to return the script running result.
557 IPC_MESSAGE_ROUTED5(
558 ExtensionHostMsg_ExecuteCodeFinished,
559 int /* request id */,
560 std::string /* error; empty implies success */,
561 int32 /* page_id the code executed on. May be -1 if unsuccessful */,
562 GURL /* URL of the code executed on. May be empty if unsuccessful. */,
563 base::ListValue /* result of the script */)
565 // Sent from the renderer to the browser to notify that content scripts are
566 // running in the renderer that the IPC originated from.
567 // Note that the page_id is for the parent (or more accurately the topmost)
568 // frame (e.g. if executing in an iframe this is the page ID of the parent,
569 // unless the parent is an iframe... etc).
570 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_ContentScriptsExecuting,
571 ExecutingScriptsMap,
572 int32 /* page_id of the _topmost_ frame */,
573 GURL /* url of the _topmost_ frame */)
575 IPC_MESSAGE_ROUTED2(ExtensionHostMsg_NotifyExtensionScriptExecution,
576 std::string /* extension id */,
577 int /* page id */)
579 // Sent by the renderer when a web page is checking if its app is installed.
580 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_GetAppInstallState,
581 GURL /* requestor_url */,
582 int32 /* return_route_id */,
583 int32 /* callback_id */)
585 // Optional Ack message sent to the browser to notify that the response to a
586 // function has been processed.
587 IPC_MESSAGE_ROUTED1(ExtensionHostMsg_ResponseAck,
588 int /* request_id */)
590 // Response to ExtensionMsg_ShouldSuspend.
591 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_ShouldSuspendAck,
592 std::string /* extension_id */,
593 int /* sequence_id */)
595 // Response to ExtensionMsg_Suspend, after we dispatch the suspend event.
596 IPC_MESSAGE_CONTROL1(ExtensionHostMsg_SuspendAck,
597 std::string /* extension_id */)
599 // Informs the browser to increment the keepalive count for the lazy background
600 // page, keeping it alive.
601 IPC_MESSAGE_ROUTED0(ExtensionHostMsg_IncrementLazyKeepaliveCount)
603 // Informs the browser there is one less thing keeping the lazy background page
604 // alive.
605 IPC_MESSAGE_ROUTED0(ExtensionHostMsg_DecrementLazyKeepaliveCount)
607 // Fetches a globally unique ID (for the lifetime of the browser) from the
608 // browser process.
609 IPC_SYNC_MESSAGE_CONTROL0_1(ExtensionHostMsg_GenerateUniqueID,
610 int /* unique_id */)
612 // Resumes resource requests for a newly created app window.
613 IPC_MESSAGE_CONTROL1(ExtensionHostMsg_ResumeRequests, int /* route_id */)
615 // Sent by the renderer when the draggable regions are updated.
616 IPC_MESSAGE_ROUTED1(ExtensionHostMsg_UpdateDraggableRegions,
617 std::vector<extensions::DraggableRegion> /* regions */)
619 // Sent by the renderer to log an API action to the extension activity log.
620 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_AddAPIActionToActivityLog,
621 std::string /* extension_id */,
622 ExtensionHostMsg_APIActionOrEvent_Params)
624 // Sent by the renderer to log an event to the extension activity log.
625 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_AddEventToActivityLog,
626 std::string /* extension_id */,
627 ExtensionHostMsg_APIActionOrEvent_Params)
629 // Sent by the renderer to log a DOM action to the extension activity log.
630 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_AddDOMActionToActivityLog,
631 std::string /* extension_id */,
632 ExtensionHostMsg_DOMAction_Params)
634 // Notifies the browser process that a tab has started or stopped matching
635 // certain conditions. This message is sent in response to several events:
637 // * ExtensionMsg_WatchPages was received, updating the set of conditions.
638 // * A new page is loaded. This will be sent after
639 // FrameHostMsg_DidCommitProvisionalLoad. Currently this only fires for the
640 // main frame.
641 // * Something changed on an existing frame causing the set of matching searches
642 // to change.
643 IPC_MESSAGE_ROUTED1(ExtensionHostMsg_OnWatchedPageChange,
644 std::vector<std::string> /* Matching CSS selectors */)