Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/shared_memory.h" | 8 #include "base/shared_memory.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 | 118 |
| 119 // The path the extension was loaded from. This is used in the renderer only | 119 // The path the extension was loaded from. This is used in the renderer only |
| 120 // to generate the extension ID for extensions that are loaded unpacked. | 120 // to generate the extension ID for extensions that are loaded unpacked. |
| 121 FilePath path; | 121 FilePath path; |
| 122 | 122 |
| 123 // The extension's active permissions. | 123 // The extension's active permissions. |
| 124 ExtensionAPIPermissionSet apis; | 124 ExtensionAPIPermissionSet apis; |
| 125 URLPatternSet explicit_hosts; | 125 URLPatternSet explicit_hosts; |
| 126 URLPatternSet scriptable_hosts; | 126 URLPatternSet scriptable_hosts; |
| 127 | 127 |
| 128 // The extension's tab-specific host permissions. | |
| 129 std::map<int, URLPatternSet> tab_specific_host_permissions; | |
|
Aaron Boodman
2012/06/08 05:31:30
I'm curious how this part is going to work when yo
not at google - send to devlin
2012/06/12 20:40:51
Yeah, good point.
Actually, in the world of not c
| |
| 130 | |
| 128 // We keep this separate so that it can be used in logging. | 131 // We keep this separate so that it can be used in logging. |
| 129 std::string id; | 132 std::string id; |
| 130 | 133 |
| 131 // Send creation flags so extension is initialized identically. | 134 // Send creation flags so extension is initialized identically. |
| 132 int creation_flags; | 135 int creation_flags; |
| 133 }; | 136 }; |
| 134 | 137 |
| 135 namespace IPC { | 138 namespace IPC { |
| 136 | 139 |
| 137 template <> | 140 template <> |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 | 234 |
| 232 // Requests application info for the page. The renderer responds back with | 235 // Requests application info for the page. The renderer responds back with |
| 233 // ExtensionHostMsg_DidGetApplicationInfo. | 236 // ExtensionHostMsg_DidGetApplicationInfo. |
| 234 IPC_MESSAGE_ROUTED1(ExtensionMsg_GetApplicationInfo, | 237 IPC_MESSAGE_ROUTED1(ExtensionMsg_GetApplicationInfo, |
| 235 int32 /*page_id*/) | 238 int32 /*page_id*/) |
| 236 | 239 |
| 237 // Tell the renderer which browser window it's being attached to. | 240 // Tell the renderer which browser window it's being attached to. |
| 238 IPC_MESSAGE_ROUTED1(ExtensionMsg_UpdateBrowserWindowId, | 241 IPC_MESSAGE_ROUTED1(ExtensionMsg_UpdateBrowserWindowId, |
| 239 int /* id of browser window */) | 242 int /* id of browser window */) |
| 240 | 243 |
| 244 // Tell the renderer what its tab ID is. | |
|
Aaron Boodman
2012/06/08 05:31:30
Technically its the render *view* that has a tab I
not at google - send to devlin
2012/06/12 20:40:51
Done.
| |
| 245 IPC_MESSAGE_ROUTED1(ExtensionMsg_SetTabId, | |
| 246 int /* id of tab */) | |
| 247 | |
| 241 // Tell the renderer to update an extension's permission set. | 248 // Tell the renderer to update an extension's permission set. |
| 242 IPC_MESSAGE_CONTROL5(ExtensionMsg_UpdatePermissions, | 249 IPC_MESSAGE_CONTROL5(ExtensionMsg_UpdatePermissions, |
| 243 int /* UpdateExtensionPermissionsInfo::REASON */, | 250 int /* UpdateExtensionPermissionsInfo::REASON */, |
| 244 std::string /* extension_id */, | 251 std::string /* extension_id */, |
| 245 ExtensionAPIPermissionSet /* permissions */, | 252 ExtensionAPIPermissionSet /* permissions */, |
| 246 URLPatternSet /* explicit_hosts */, | 253 URLPatternSet /* explicit_hosts */, |
| 247 URLPatternSet /* scriptable_hosts */) | 254 URLPatternSet /* scriptable_hosts */) |
| 248 | 255 |
| 256 // Tell the renderer about new tab-specific permissions for an extension. | |
|
Aaron Boodman
2012/06/08 05:31:30
It seems like this duplicates the functionality of
not at google - send to devlin
2012/06/12 20:40:51
It would be a bit awkward to re-use it, but it's m
| |
| 257 IPC_MESSAGE_CONTROL4(ExtensionMsg_SetTabSpecificPermissions, | |
| 258 int32 /* page_id (only relevant for the target tab) */, | |
| 259 int /* tab_id */, | |
| 260 std::string /* extension_id */, | |
| 261 URLPatternSet /* host */) | |
| 262 | |
| 263 // Tell the renderer to clear tab-specific permissions for some extensions. | |
| 264 IPC_MESSAGE_CONTROL2(ExtensionMsg_ClearTabSpecificPermissions, | |
| 265 int /* tab_id */, | |
| 266 std::vector<std::string> /* extension_ids */) | |
| 267 | |
| 249 // Tell the renderer which type this view is. | 268 // Tell the renderer which type this view is. |
| 250 IPC_MESSAGE_ROUTED1(ExtensionMsg_NotifyRenderViewType, | 269 IPC_MESSAGE_ROUTED1(ExtensionMsg_NotifyRenderViewType, |
| 251 chrome::ViewType /* view_type */) | 270 chrome::ViewType /* view_type */) |
| 252 | 271 |
| 253 // Deliver a message sent with ExtensionHostMsg_PostMessage. | 272 // Deliver a message sent with ExtensionHostMsg_PostMessage. |
| 254 IPC_MESSAGE_CONTROL3(ExtensionMsg_UsingWebRequestAPI, | 273 IPC_MESSAGE_CONTROL3(ExtensionMsg_UsingWebRequestAPI, |
| 255 bool /* adblock */, | 274 bool /* adblock */, |
| 256 bool /* adblock_plus */, | 275 bool /* adblock_plus */, |
| 257 bool /* other_webrequest */) | 276 bool /* other_webrequest */) |
| 258 | 277 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 449 IPC_MESSAGE_ROUTED0(ExtensionHostMsg_IncrementLazyKeepaliveCount) | 468 IPC_MESSAGE_ROUTED0(ExtensionHostMsg_IncrementLazyKeepaliveCount) |
| 450 | 469 |
| 451 // Informs the browser there is one less thing keeping the lazy background page | 470 // Informs the browser there is one less thing keeping the lazy background page |
| 452 // alive. | 471 // alive. |
| 453 IPC_MESSAGE_ROUTED0(ExtensionHostMsg_DecrementLazyKeepaliveCount) | 472 IPC_MESSAGE_ROUTED0(ExtensionHostMsg_DecrementLazyKeepaliveCount) |
| 454 | 473 |
| 455 // Fetches a globally unique ID (for the lifetime of the browser) from the | 474 // Fetches a globally unique ID (for the lifetime of the browser) from the |
| 456 // browser process. | 475 // browser process. |
| 457 IPC_SYNC_MESSAGE_CONTROL0_1(ExtensionHostMsg_GenerateUniqueID, | 476 IPC_SYNC_MESSAGE_CONTROL0_1(ExtensionHostMsg_GenerateUniqueID, |
| 458 int /* unique_id */) | 477 int /* unique_id */) |
| OLD | NEW |