Chromium Code Reviews| 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> |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 265 ExtensionMsg_PermissionSetStruct( | 265 ExtensionMsg_PermissionSetStruct( |
| 266 const ExtensionMsg_PermissionSetStruct& other); | 266 const ExtensionMsg_PermissionSetStruct& other); |
| 267 ~ExtensionMsg_PermissionSetStruct(); | 267 ~ExtensionMsg_PermissionSetStruct(); |
| 268 | 268 |
| 269 std::unique_ptr<const extensions::PermissionSet> ToPermissionSet() const; | 269 std::unique_ptr<const extensions::PermissionSet> ToPermissionSet() const; |
| 270 | 270 |
| 271 extensions::APIPermissionSet apis; | 271 extensions::APIPermissionSet apis; |
| 272 extensions::ManifestPermissionSet manifest_permissions; | 272 extensions::ManifestPermissionSet manifest_permissions; |
| 273 extensions::URLPatternSet explicit_hosts; | 273 extensions::URLPatternSet explicit_hosts; |
| 274 extensions::URLPatternSet scriptable_hosts; | 274 extensions::URLPatternSet scriptable_hosts; |
| 275 extensions::URLPatternSet policy_blocked_hosts; | |
| 276 extensions::URLPatternSet policy_allowed_hosts; | |
| 277 bool uses_default_policy_host_restrictions; | |
| 275 }; | 278 }; |
| 276 | 279 |
| 277 struct ExtensionMsg_Loaded_Params { | 280 struct ExtensionMsg_Loaded_Params { |
| 278 ExtensionMsg_Loaded_Params(); | 281 ExtensionMsg_Loaded_Params(); |
| 279 ~ExtensionMsg_Loaded_Params(); | 282 ~ExtensionMsg_Loaded_Params(); |
| 280 ExtensionMsg_Loaded_Params(const extensions::Extension* extension, | 283 ExtensionMsg_Loaded_Params(const extensions::Extension* extension, |
| 281 bool include_tab_permissions); | 284 bool include_tab_permissions); |
| 282 ExtensionMsg_Loaded_Params(const ExtensionMsg_Loaded_Params& other); | 285 ExtensionMsg_Loaded_Params(const ExtensionMsg_Loaded_Params& other); |
| 283 | 286 |
| 284 // Creates a new extension from the data in this object. | 287 // Creates a new extension from the data in this object. |
| 285 scoped_refptr<extensions::Extension> ConvertToExtension( | 288 scoped_refptr<extensions::Extension> ConvertToExtension( |
| 286 std::string* error) const; | 289 std::string* error) const; |
| 287 | 290 |
| 288 // The subset of the extension manifest data we send to renderers. | 291 // The subset of the extension manifest data we send to renderers. |
| 289 linked_ptr<base::DictionaryValue> manifest; | 292 linked_ptr<base::DictionaryValue> manifest; |
| 290 | 293 |
| 291 // The location the extension was installed from. | 294 // The location the extension was installed from. |
| 292 extensions::Manifest::Location location; | 295 extensions::Manifest::Location location; |
| 293 | 296 |
| 294 // The path the extension was loaded from. This is used in the renderer only | 297 // The path the extension was loaded from. This is used in the renderer only |
| 295 // to generate the extension ID for extensions that are loaded unpacked. | 298 // to generate the extension ID for extensions that are loaded unpacked. |
| 296 base::FilePath path; | 299 base::FilePath path; |
| 297 | 300 |
| 298 // The extension's active and withheld permissions. | 301 // The extension's active and withheld permissions. |
| 299 ExtensionMsg_PermissionSetStruct active_permissions; | 302 ExtensionMsg_PermissionSetStruct active_permissions; |
| 300 ExtensionMsg_PermissionSetStruct withheld_permissions; | 303 ExtensionMsg_PermissionSetStruct withheld_permissions; |
| 301 std::map<int, ExtensionMsg_PermissionSetStruct> tab_specific_permissions; | 304 std::map<int, ExtensionMsg_PermissionSetStruct> tab_specific_permissions; |
| 302 | 305 |
| 306 // Contians URLPatternSets defining which URLs an extension may not interact | |
|
Devlin
2017/03/29 21:36:50
s/Contians/Contains
nrpeter
2017/03/30 00:06:06
Done.
| |
| 307 // with by policy. | |
| 308 extensions::URLPatternSet policy_blocked_hosts; | |
| 309 extensions::URLPatternSet policy_allowed_hosts; | |
| 310 | |
| 311 // If the extension uses the default list of blocked / allowed URLs. | |
| 312 bool is_default_policy_blocked_allowed_hosts; | |
| 313 | |
| 303 // We keep this separate so that it can be used in logging. | 314 // We keep this separate so that it can be used in logging. |
| 304 std::string id; | 315 std::string id; |
| 305 | 316 |
| 306 // Send creation flags so extension is initialized identically. | 317 // Send creation flags so extension is initialized identically. |
| 307 int creation_flags; | 318 int creation_flags; |
| 308 }; | 319 }; |
| 309 | 320 |
| 310 struct ExtensionHostMsg_AutomationQuerySelector_Error { | 321 struct ExtensionHostMsg_AutomationQuerySelector_Error { |
| 311 enum Value { kNone, kNoMainFrame, kNoDocument, kNodeDestroyed }; | 322 enum Value { kNone, kNoMainFrame, kNoDocument, kNodeDestroyed }; |
| 312 | 323 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 414 | 425 |
| 415 IPC_STRUCT_TRAITS_BEGIN(ExtensionHostMsg_AutomationQuerySelector_Error) | 426 IPC_STRUCT_TRAITS_BEGIN(ExtensionHostMsg_AutomationQuerySelector_Error) |
| 416 IPC_STRUCT_TRAITS_MEMBER(value) | 427 IPC_STRUCT_TRAITS_MEMBER(value) |
| 417 IPC_STRUCT_TRAITS_END() | 428 IPC_STRUCT_TRAITS_END() |
| 418 | 429 |
| 419 // Parameters structure for ExtensionMsg_UpdatePermissions. | 430 // Parameters structure for ExtensionMsg_UpdatePermissions. |
| 420 IPC_STRUCT_BEGIN(ExtensionMsg_UpdatePermissions_Params) | 431 IPC_STRUCT_BEGIN(ExtensionMsg_UpdatePermissions_Params) |
| 421 IPC_STRUCT_MEMBER(std::string, extension_id) | 432 IPC_STRUCT_MEMBER(std::string, extension_id) |
| 422 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, active_permissions) | 433 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, active_permissions) |
| 423 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, withheld_permissions) | 434 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, withheld_permissions) |
| 435 IPC_STRUCT_MEMBER(extensions::URLPatternSet, policy_blocked_hosts) | |
| 436 IPC_STRUCT_MEMBER(extensions::URLPatternSet, policy_allowed_hosts) | |
| 437 IPC_STRUCT_MEMBER(bool, uses_default_policy_host_restrictions) | |
| 438 IPC_STRUCT_END() | |
| 439 | |
| 440 // Parameters structure for ExtensionMsg_UpdateDefaultPolicyHostRestrictions. | |
| 441 IPC_STRUCT_BEGIN(ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params) | |
| 442 IPC_STRUCT_MEMBER(extensions::URLPatternSet, default_policy_blocked_hosts) | |
| 443 IPC_STRUCT_MEMBER(extensions::URLPatternSet, default_policy_allowed_hosts) | |
| 424 IPC_STRUCT_END() | 444 IPC_STRUCT_END() |
| 425 | 445 |
| 426 // Messages sent from the browser to the renderer: | 446 // Messages sent from the browser to the renderer: |
| 427 | 447 |
| 428 // The browser sends this message in response to all extension api calls. The | 448 // The browser sends this message in response to all extension api calls. The |
| 429 // response data (if any) is one of the base::Value subclasses, wrapped as the | 449 // response data (if any) is one of the base::Value subclasses, wrapped as the |
| 430 // first element in a ListValue. | 450 // first element in a ListValue. |
| 431 IPC_MESSAGE_ROUTED4(ExtensionMsg_Response, | 451 IPC_MESSAGE_ROUTED4(ExtensionMsg_Response, |
| 432 int /* request_id */, | 452 int /* request_id */, |
| 433 bool /* success */, | 453 bool /* success */, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 514 int /* id of browser window */) | 534 int /* id of browser window */) |
| 515 | 535 |
| 516 // Tell the render view what its tab ID is. | 536 // Tell the render view what its tab ID is. |
| 517 IPC_MESSAGE_ROUTED1(ExtensionMsg_SetTabId, | 537 IPC_MESSAGE_ROUTED1(ExtensionMsg_SetTabId, |
| 518 int /* id of tab */) | 538 int /* id of tab */) |
| 519 | 539 |
| 520 // Tell the renderer to update an extension's permission set. | 540 // Tell the renderer to update an extension's permission set. |
| 521 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdatePermissions, | 541 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdatePermissions, |
| 522 ExtensionMsg_UpdatePermissions_Params) | 542 ExtensionMsg_UpdatePermissions_Params) |
| 523 | 543 |
| 544 // Tell the renderer to update an extension's policy_blocked_hosts set. | |
| 545 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdateDefaultPolicyHostRestrictions, | |
| 546 ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params) | |
| 547 | |
| 524 // Tell the render view about new tab-specific permissions for an extension. | 548 // Tell the render view about new tab-specific permissions for an extension. |
| 525 IPC_MESSAGE_CONTROL5(ExtensionMsg_UpdateTabSpecificPermissions, | 549 IPC_MESSAGE_CONTROL5(ExtensionMsg_UpdateTabSpecificPermissions, |
| 526 GURL /* url */, | 550 GURL /* url */, |
| 527 std::string /* extension_id */, | 551 std::string /* extension_id */, |
| 528 extensions::URLPatternSet /* hosts */, | 552 extensions::URLPatternSet /* hosts */, |
| 529 bool /* update origin whitelist */, | 553 bool /* update origin whitelist */, |
| 530 int /* tab_id */) | 554 int /* tab_id */) |
| 531 | 555 |
| 532 // Tell the render view to clear tab-specific permissions for some extensions. | 556 // Tell the render view to clear tab-specific permissions for some extensions. |
| 533 IPC_MESSAGE_CONTROL3(ExtensionMsg_ClearTabSpecificPermissions, | 557 IPC_MESSAGE_CONTROL3(ExtensionMsg_ClearTabSpecificPermissions, |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 894 int64_t /* service_worker_version_id */, | 918 int64_t /* service_worker_version_id */, |
| 895 std::string /* request_uuid */) | 919 std::string /* request_uuid */) |
| 896 | 920 |
| 897 // Asks the browser to decrement the pending activity count for | 921 // Asks the browser to decrement the pending activity count for |
| 898 // the worker with version id |service_worker_version_id|. | 922 // the worker with version id |service_worker_version_id|. |
| 899 // |request_uuid| must match the GUID of a previous request, otherwise the | 923 // |request_uuid| must match the GUID of a previous request, otherwise the |
| 900 // browser process ignores the IPC. | 924 // browser process ignores the IPC. |
| 901 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_DecrementServiceWorkerActivity, | 925 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_DecrementServiceWorkerActivity, |
| 902 int64_t /* service_worker_version_id */, | 926 int64_t /* service_worker_version_id */, |
| 903 std::string /* request_uuid */) | 927 std::string /* request_uuid */) |
| OLD | NEW |