Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: extensions/common/extension_messages.h

Issue 2820333003: Revert of Communicate ExtensionSettings policy to renderers (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/common/extension.h ('k') | extensions/common/extension_messages.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 ExtensionMsg_PermissionSetStruct( 286 ExtensionMsg_PermissionSetStruct(
287 const ExtensionMsg_PermissionSetStruct& other); 287 const ExtensionMsg_PermissionSetStruct& other);
288 ~ExtensionMsg_PermissionSetStruct(); 288 ~ExtensionMsg_PermissionSetStruct();
289 289
290 std::unique_ptr<const extensions::PermissionSet> ToPermissionSet() const; 290 std::unique_ptr<const extensions::PermissionSet> ToPermissionSet() const;
291 291
292 extensions::APIPermissionSet apis; 292 extensions::APIPermissionSet apis;
293 extensions::ManifestPermissionSet manifest_permissions; 293 extensions::ManifestPermissionSet manifest_permissions;
294 extensions::URLPatternSet explicit_hosts; 294 extensions::URLPatternSet explicit_hosts;
295 extensions::URLPatternSet scriptable_hosts; 295 extensions::URLPatternSet scriptable_hosts;
296 extensions::URLPatternSet policy_blocked_hosts;
297 extensions::URLPatternSet policy_allowed_hosts;
298 bool uses_default_policy_host_restrictions;
299 }; 296 };
300 297
301 struct ExtensionMsg_Loaded_Params { 298 struct ExtensionMsg_Loaded_Params {
302 ExtensionMsg_Loaded_Params(); 299 ExtensionMsg_Loaded_Params();
303 ~ExtensionMsg_Loaded_Params(); 300 ~ExtensionMsg_Loaded_Params();
304 ExtensionMsg_Loaded_Params(const extensions::Extension* extension, 301 ExtensionMsg_Loaded_Params(const extensions::Extension* extension,
305 bool include_tab_permissions); 302 bool include_tab_permissions);
306 ExtensionMsg_Loaded_Params(const ExtensionMsg_Loaded_Params& other); 303 ExtensionMsg_Loaded_Params(const ExtensionMsg_Loaded_Params& other);
307 304
308 // Creates a new extension from the data in this object. 305 // Creates a new extension from the data in this object.
309 scoped_refptr<extensions::Extension> ConvertToExtension( 306 scoped_refptr<extensions::Extension> ConvertToExtension(
310 std::string* error) const; 307 std::string* error) const;
311 308
312 // The subset of the extension manifest data we send to renderers. 309 // The subset of the extension manifest data we send to renderers.
313 linked_ptr<base::DictionaryValue> manifest; 310 linked_ptr<base::DictionaryValue> manifest;
314 311
315 // The location the extension was installed from. 312 // The location the extension was installed from.
316 extensions::Manifest::Location location; 313 extensions::Manifest::Location location;
317 314
318 // The path the extension was loaded from. This is used in the renderer only 315 // The path the extension was loaded from. This is used in the renderer only
319 // to generate the extension ID for extensions that are loaded unpacked. 316 // to generate the extension ID for extensions that are loaded unpacked.
320 base::FilePath path; 317 base::FilePath path;
321 318
322 // The extension's active and withheld permissions. 319 // The extension's active and withheld permissions.
323 ExtensionMsg_PermissionSetStruct active_permissions; 320 ExtensionMsg_PermissionSetStruct active_permissions;
324 ExtensionMsg_PermissionSetStruct withheld_permissions; 321 ExtensionMsg_PermissionSetStruct withheld_permissions;
325 std::map<int, ExtensionMsg_PermissionSetStruct> tab_specific_permissions; 322 std::map<int, ExtensionMsg_PermissionSetStruct> tab_specific_permissions;
326 323
327 // Contains URLPatternSets defining which URLs an extension may not interact
328 // with by policy.
329 extensions::URLPatternSet policy_blocked_hosts;
330 extensions::URLPatternSet policy_allowed_hosts;
331
332 // If the extension uses the default list of blocked / allowed URLs.
333 bool uses_default_policy_blocked_allowed_hosts;
334
335 // We keep this separate so that it can be used in logging. 324 // We keep this separate so that it can be used in logging.
336 std::string id; 325 std::string id;
337 326
338 // Send creation flags so extension is initialized identically. 327 // Send creation flags so extension is initialized identically.
339 int creation_flags; 328 int creation_flags;
340 }; 329 };
341 330
342 struct ExtensionHostMsg_AutomationQuerySelector_Error { 331 struct ExtensionHostMsg_AutomationQuerySelector_Error {
343 enum Value { kNone, kNoMainFrame, kNoDocument, kNodeDestroyed }; 332 enum Value { kNone, kNoMainFrame, kNoDocument, kNodeDestroyed };
344 333
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 435
447 IPC_STRUCT_TRAITS_BEGIN(ExtensionHostMsg_AutomationQuerySelector_Error) 436 IPC_STRUCT_TRAITS_BEGIN(ExtensionHostMsg_AutomationQuerySelector_Error)
448 IPC_STRUCT_TRAITS_MEMBER(value) 437 IPC_STRUCT_TRAITS_MEMBER(value)
449 IPC_STRUCT_TRAITS_END() 438 IPC_STRUCT_TRAITS_END()
450 439
451 // Parameters structure for ExtensionMsg_UpdatePermissions. 440 // Parameters structure for ExtensionMsg_UpdatePermissions.
452 IPC_STRUCT_BEGIN(ExtensionMsg_UpdatePermissions_Params) 441 IPC_STRUCT_BEGIN(ExtensionMsg_UpdatePermissions_Params)
453 IPC_STRUCT_MEMBER(std::string, extension_id) 442 IPC_STRUCT_MEMBER(std::string, extension_id)
454 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, active_permissions) 443 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, active_permissions)
455 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, withheld_permissions) 444 IPC_STRUCT_MEMBER(ExtensionMsg_PermissionSetStruct, withheld_permissions)
456 IPC_STRUCT_MEMBER(extensions::URLPatternSet, policy_blocked_hosts)
457 IPC_STRUCT_MEMBER(extensions::URLPatternSet, policy_allowed_hosts)
458 IPC_STRUCT_MEMBER(bool, uses_default_policy_host_restrictions)
459 IPC_STRUCT_END()
460
461 // Parameters structure for ExtensionMsg_UpdateDefaultPolicyHostRestrictions.
462 IPC_STRUCT_BEGIN(ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params)
463 IPC_STRUCT_MEMBER(extensions::URLPatternSet, default_policy_blocked_hosts)
464 IPC_STRUCT_MEMBER(extensions::URLPatternSet, default_policy_allowed_hosts)
465 IPC_STRUCT_END() 445 IPC_STRUCT_END()
466 446
467 // Messages sent from the browser to the renderer: 447 // Messages sent from the browser to the renderer:
468 448
469 // The browser sends this message in response to all extension api calls. The 449 // The browser sends this message in response to all extension api calls. The
470 // response data (if any) is one of the base::Value subclasses, wrapped as the 450 // response data (if any) is one of the base::Value subclasses, wrapped as the
471 // first element in a ListValue. 451 // first element in a ListValue.
472 IPC_MESSAGE_ROUTED4(ExtensionMsg_Response, 452 IPC_MESSAGE_ROUTED4(ExtensionMsg_Response,
473 int /* request_id */, 453 int /* request_id */,
474 bool /* success */, 454 bool /* success */,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 int /* id of browser window */) 541 int /* id of browser window */)
562 542
563 // Tell the render view what its tab ID is. 543 // Tell the render view what its tab ID is.
564 IPC_MESSAGE_ROUTED1(ExtensionMsg_SetTabId, 544 IPC_MESSAGE_ROUTED1(ExtensionMsg_SetTabId,
565 int /* id of tab */) 545 int /* id of tab */)
566 546
567 // Tell the renderer to update an extension's permission set. 547 // Tell the renderer to update an extension's permission set.
568 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdatePermissions, 548 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdatePermissions,
569 ExtensionMsg_UpdatePermissions_Params) 549 ExtensionMsg_UpdatePermissions_Params)
570 550
571 // Tell the renderer to update an extension's policy_blocked_hosts set.
572 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdateDefaultPolicyHostRestrictions,
573 ExtensionMsg_UpdateDefaultPolicyHostRestrictions_Params)
574
575 // Tell the render view about new tab-specific permissions for an extension. 551 // Tell the render view about new tab-specific permissions for an extension.
576 IPC_MESSAGE_CONTROL5(ExtensionMsg_UpdateTabSpecificPermissions, 552 IPC_MESSAGE_CONTROL5(ExtensionMsg_UpdateTabSpecificPermissions,
577 GURL /* url */, 553 GURL /* url */,
578 std::string /* extension_id */, 554 std::string /* extension_id */,
579 extensions::URLPatternSet /* hosts */, 555 extensions::URLPatternSet /* hosts */,
580 bool /* update origin whitelist */, 556 bool /* update origin whitelist */,
581 int /* tab_id */) 557 int /* tab_id */)
582 558
583 // Tell the render view to clear tab-specific permissions for some extensions. 559 // Tell the render view to clear tab-specific permissions for some extensions.
584 IPC_MESSAGE_CONTROL3(ExtensionMsg_ClearTabSpecificPermissions, 560 IPC_MESSAGE_CONTROL3(ExtensionMsg_ClearTabSpecificPermissions,
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 int64_t /* service_worker_version_id */, 914 int64_t /* service_worker_version_id */,
939 std::string /* request_uuid */) 915 std::string /* request_uuid */)
940 916
941 // Asks the browser to decrement the pending activity count for 917 // Asks the browser to decrement the pending activity count for
942 // the worker with version id |service_worker_version_id|. 918 // the worker with version id |service_worker_version_id|.
943 // |request_uuid| must match the GUID of a previous request, otherwise the 919 // |request_uuid| must match the GUID of a previous request, otherwise the
944 // browser process ignores the IPC. 920 // browser process ignores the IPC.
945 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_DecrementServiceWorkerActivity, 921 IPC_MESSAGE_CONTROL2(ExtensionHostMsg_DecrementServiceWorkerActivity,
946 int64_t /* service_worker_version_id */, 922 int64_t /* service_worker_version_id */,
947 std::string /* request_uuid */) 923 std::string /* request_uuid */)
OLDNEW
« no previous file with comments | « extensions/common/extension.h ('k') | extensions/common/extension_messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698