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 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 251 |
252 extensions::APIPermissionSet apis; | 252 extensions::APIPermissionSet apis; |
253 extensions::ManifestPermissionSet manifest_permissions; | 253 extensions::ManifestPermissionSet manifest_permissions; |
254 extensions::URLPatternSet explicit_hosts; | 254 extensions::URLPatternSet explicit_hosts; |
255 extensions::URLPatternSet scriptable_hosts; | 255 extensions::URLPatternSet scriptable_hosts; |
256 }; | 256 }; |
257 | 257 |
258 struct ExtensionMsg_Loaded_Params { | 258 struct ExtensionMsg_Loaded_Params { |
259 ExtensionMsg_Loaded_Params(); | 259 ExtensionMsg_Loaded_Params(); |
260 ~ExtensionMsg_Loaded_Params(); | 260 ~ExtensionMsg_Loaded_Params(); |
261 explicit ExtensionMsg_Loaded_Params(const extensions::Extension* extension); | 261 ExtensionMsg_Loaded_Params(const extensions::Extension* extension, |
| 262 bool include_tab_permissions); |
262 | 263 |
263 // Creates a new extension from the data in this object. | 264 // Creates a new extension from the data in this object. |
264 scoped_refptr<extensions::Extension> ConvertToExtension( | 265 scoped_refptr<extensions::Extension> ConvertToExtension( |
265 std::string* error) const; | 266 std::string* error) const; |
266 | 267 |
267 // The subset of the extension manifest data we send to renderers. | 268 // The subset of the extension manifest data we send to renderers. |
268 linked_ptr<base::DictionaryValue> manifest; | 269 linked_ptr<base::DictionaryValue> manifest; |
269 | 270 |
270 // The location the extension was installed from. | 271 // The location the extension was installed from. |
271 extensions::Manifest::Location location; | 272 extensions::Manifest::Location location; |
272 | 273 |
273 // The path the extension was loaded from. This is used in the renderer only | 274 // The path the extension was loaded from. This is used in the renderer only |
274 // to generate the extension ID for extensions that are loaded unpacked. | 275 // to generate the extension ID for extensions that are loaded unpacked. |
275 base::FilePath path; | 276 base::FilePath path; |
276 | 277 |
277 // The extension's active and withheld permissions. | 278 // The extension's active and withheld permissions. |
278 ExtensionMsg_PermissionSetStruct active_permissions; | 279 ExtensionMsg_PermissionSetStruct active_permissions; |
279 ExtensionMsg_PermissionSetStruct withheld_permissions; | 280 ExtensionMsg_PermissionSetStruct withheld_permissions; |
| 281 std::map<int, ExtensionMsg_PermissionSetStruct> tab_specific_permissions; |
280 | 282 |
281 // We keep this separate so that it can be used in logging. | 283 // We keep this separate so that it can be used in logging. |
282 std::string id; | 284 std::string id; |
283 | 285 |
284 // Send creation flags so extension is initialized identically. | 286 // Send creation flags so extension is initialized identically. |
285 int creation_flags; | 287 int creation_flags; |
286 }; | 288 }; |
287 | 289 |
288 struct ExtensionHostMsg_AutomationQuerySelector_Error { | 290 struct ExtensionHostMsg_AutomationQuerySelector_Error { |
289 enum Value { kNone, kNoMainFrame, kNoDocument, kNodeDestroyed }; | 291 enum Value { kNone, kNoMainFrame, kNoDocument, kNodeDestroyed }; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 | 464 |
463 // Tell the render view what its tab ID is. | 465 // Tell the render view what its tab ID is. |
464 IPC_MESSAGE_ROUTED1(ExtensionMsg_SetTabId, | 466 IPC_MESSAGE_ROUTED1(ExtensionMsg_SetTabId, |
465 int /* id of tab */) | 467 int /* id of tab */) |
466 | 468 |
467 // Tell the renderer to update an extension's permission set. | 469 // Tell the renderer to update an extension's permission set. |
468 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdatePermissions, | 470 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdatePermissions, |
469 ExtensionMsg_UpdatePermissions_Params) | 471 ExtensionMsg_UpdatePermissions_Params) |
470 | 472 |
471 // Tell the render view about new tab-specific permissions for an extension. | 473 // Tell the render view about new tab-specific permissions for an extension. |
472 IPC_MESSAGE_ROUTED3(ExtensionMsg_UpdateTabSpecificPermissions, | 474 IPC_MESSAGE_CONTROL5(ExtensionMsg_UpdateTabSpecificPermissions, |
473 GURL /* url */, | 475 GURL /* url */, |
474 std::string /* extension_id */, | 476 std::string /* extension_id */, |
475 extensions::URLPatternSet /* hosts */) | 477 extensions::URLPatternSet /* hosts */, |
| 478 bool /* update origin whitelist */, |
| 479 int /* tab_id */) |
476 | 480 |
477 // Tell the render view to clear tab-specific permissions for some extensions. | 481 // Tell the render view to clear tab-specific permissions for some extensions. |
478 IPC_MESSAGE_ROUTED1(ExtensionMsg_ClearTabSpecificPermissions, | 482 IPC_MESSAGE_CONTROL3(ExtensionMsg_ClearTabSpecificPermissions, |
479 std::vector<std::string> /* extension_ids */) | 483 std::vector<std::string> /* extension_ids */, |
| 484 bool /* update origin whitelist */, |
| 485 int /* tab_id */) |
480 | 486 |
481 // Tell the renderer which type this view is. | 487 // Tell the renderer which type this view is. |
482 IPC_MESSAGE_ROUTED1(ExtensionMsg_NotifyRenderViewType, | 488 IPC_MESSAGE_ROUTED1(ExtensionMsg_NotifyRenderViewType, |
483 extensions::ViewType /* view_type */) | 489 extensions::ViewType /* view_type */) |
484 | 490 |
485 // Deliver a message sent with ExtensionHostMsg_PostMessage. | 491 // Deliver a message sent with ExtensionHostMsg_PostMessage. |
486 IPC_MESSAGE_CONTROL1(ExtensionMsg_UsingWebRequestAPI, | 492 IPC_MESSAGE_CONTROL1(ExtensionMsg_UsingWebRequestAPI, |
487 bool /* webrequest_used */) | 493 bool /* webrequest_used */) |
488 | 494 |
489 // Ask the lazy background page if it is ready to be suspended. This is sent | 495 // Ask the lazy background page if it is ready to be suspended. This is sent |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 int /* acc_obj_id */, | 780 int /* acc_obj_id */, |
775 base::string16 /* selector */) | 781 base::string16 /* selector */) |
776 | 782 |
777 // Result of a query selector request. | 783 // Result of a query selector request. |
778 // result_acc_obj_id is the accessibility tree ID of the result element; 0 | 784 // result_acc_obj_id is the accessibility tree ID of the result element; 0 |
779 // indicates no result. | 785 // indicates no result. |
780 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_AutomationQuerySelector_Result, | 786 IPC_MESSAGE_ROUTED3(ExtensionHostMsg_AutomationQuerySelector_Result, |
781 int /* request_id */, | 787 int /* request_id */, |
782 ExtensionHostMsg_AutomationQuerySelector_Error /* error */, | 788 ExtensionHostMsg_AutomationQuerySelector_Error /* error */, |
783 int /* result_acc_obj_id */) | 789 int /* result_acc_obj_id */) |
OLD | NEW |