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

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

Issue 51433002: Enable permission warnings from ManifestHandlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address code review comments. Created 7 years, 1 month 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
OLDNEW
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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 IPC_STRUCT_MEMBER(std::string, target_id) 136 IPC_STRUCT_MEMBER(std::string, target_id)
137 137
138 // The ID of the extension that initiated the request. May be empty if it 138 // The ID of the extension that initiated the request. May be empty if it
139 // wasn't initiated by an extension. 139 // wasn't initiated by an extension.
140 IPC_STRUCT_MEMBER(std::string, source_id) 140 IPC_STRUCT_MEMBER(std::string, source_id)
141 141
142 // The URL of the frame that initiated the request. 142 // The URL of the frame that initiated the request.
143 IPC_STRUCT_MEMBER(GURL, source_url) 143 IPC_STRUCT_MEMBER(GURL, source_url)
144 IPC_STRUCT_END() 144 IPC_STRUCT_END()
145 145
146 // Parameters structure for ExtensionMsg_UpdatePermissions.
147 IPC_STRUCT_BEGIN(ExtensionMsg_UpdatePermissions_Params)
148 IPC_STRUCT_MEMBER(int /* UpdateExtensionPermissionsInfo::REASON */, reason_id)
149 IPC_STRUCT_MEMBER(std::string, extension_id)
150 IPC_STRUCT_MEMBER(extensions::APIPermissionSet, apis)
151 IPC_STRUCT_MEMBER(extensions::ManifestPermissionSet, manifest_permissions)
152 IPC_STRUCT_MEMBER(extensions::URLPatternSet, explicit_hosts)
153 IPC_STRUCT_MEMBER(extensions::URLPatternSet, scriptable_hosts)
154 IPC_STRUCT_END()
155
146 IPC_STRUCT_TRAITS_BEGIN(WebApplicationInfo::IconInfo) 156 IPC_STRUCT_TRAITS_BEGIN(WebApplicationInfo::IconInfo)
147 IPC_STRUCT_TRAITS_MEMBER(url) 157 IPC_STRUCT_TRAITS_MEMBER(url)
148 IPC_STRUCT_TRAITS_MEMBER(width) 158 IPC_STRUCT_TRAITS_MEMBER(width)
149 IPC_STRUCT_TRAITS_MEMBER(height) 159 IPC_STRUCT_TRAITS_MEMBER(height)
150 IPC_STRUCT_TRAITS_MEMBER(data) 160 IPC_STRUCT_TRAITS_MEMBER(data)
151 IPC_STRUCT_TRAITS_END() 161 IPC_STRUCT_TRAITS_END()
152 162
153 IPC_STRUCT_TRAITS_BEGIN(WebApplicationInfo) 163 IPC_STRUCT_TRAITS_BEGIN(WebApplicationInfo)
154 IPC_STRUCT_TRAITS_MEMBER(title) 164 IPC_STRUCT_TRAITS_MEMBER(title)
155 IPC_STRUCT_TRAITS_MEMBER(description) 165 IPC_STRUCT_TRAITS_MEMBER(description)
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 236
227 // The location the extension was installed from. 237 // The location the extension was installed from.
228 extensions::Manifest::Location location; 238 extensions::Manifest::Location location;
229 239
230 // The path the extension was loaded from. This is used in the renderer only 240 // The path the extension was loaded from. This is used in the renderer only
231 // to generate the extension ID for extensions that are loaded unpacked. 241 // to generate the extension ID for extensions that are loaded unpacked.
232 base::FilePath path; 242 base::FilePath path;
233 243
234 // The extension's active permissions. 244 // The extension's active permissions.
235 extensions::APIPermissionSet apis; 245 extensions::APIPermissionSet apis;
246 extensions::ManifestPermissionSet manifest_permissions;
236 extensions::URLPatternSet explicit_hosts; 247 extensions::URLPatternSet explicit_hosts;
237 extensions::URLPatternSet scriptable_hosts; 248 extensions::URLPatternSet scriptable_hosts;
238 249
239 // We keep this separate so that it can be used in logging. 250 // We keep this separate so that it can be used in logging.
240 std::string id; 251 std::string id;
241 252
242 // Send creation flags so extension is initialized identically. 253 // Send creation flags so extension is initialized identically.
243 int creation_flags; 254 int creation_flags;
244 }; 255 };
245 256
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 288
278 template <> 289 template <>
279 struct ParamTraits<extensions::APIPermissionSet> { 290 struct ParamTraits<extensions::APIPermissionSet> {
280 typedef extensions::APIPermissionSet param_type; 291 typedef extensions::APIPermissionSet param_type;
281 static void Write(Message* m, const param_type& p); 292 static void Write(Message* m, const param_type& p);
282 static bool Read(const Message* m, PickleIterator* iter, param_type* r); 293 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
283 static void Log(const param_type& p, std::string* l); 294 static void Log(const param_type& p, std::string* l);
284 }; 295 };
285 296
286 template <> 297 template <>
298 struct ParamTraits<extensions::ManifestPermissionSet> {
299 typedef extensions::ManifestPermissionSet param_type;
300 static void Write(Message* m, const param_type& p);
301 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
302 static void Log(const param_type& p, std::string* l);
303 };
304
305 template <>
287 struct ParamTraits<ExtensionMsg_Loaded_Params> { 306 struct ParamTraits<ExtensionMsg_Loaded_Params> {
288 typedef ExtensionMsg_Loaded_Params param_type; 307 typedef ExtensionMsg_Loaded_Params param_type;
289 static void Write(Message* m, const param_type& p); 308 static void Write(Message* m, const param_type& p);
290 static bool Read(const Message* m, PickleIterator* iter, param_type* p); 309 static bool Read(const Message* m, PickleIterator* iter, param_type* p);
291 static void Log(const param_type& p, std::string* l); 310 static void Log(const param_type& p, std::string* l);
292 }; 311 };
293 312
294 } // namespace IPC 313 } // namespace IPC
295 314
296 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_MESSAGES_H_ 315 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_MESSAGES_H_
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 386
368 // Tell the render view which browser window it's being attached to. 387 // Tell the render view which browser window it's being attached to.
369 IPC_MESSAGE_ROUTED1(ExtensionMsg_UpdateBrowserWindowId, 388 IPC_MESSAGE_ROUTED1(ExtensionMsg_UpdateBrowserWindowId,
370 int /* id of browser window */) 389 int /* id of browser window */)
371 390
372 // Tell the render view what its tab ID is. 391 // Tell the render view what its tab ID is.
373 IPC_MESSAGE_ROUTED1(ExtensionMsg_SetTabId, 392 IPC_MESSAGE_ROUTED1(ExtensionMsg_SetTabId,
374 int /* id of tab */) 393 int /* id of tab */)
375 394
376 // Tell the renderer to update an extension's permission set. 395 // Tell the renderer to update an extension's permission set.
377 IPC_MESSAGE_CONTROL5(ExtensionMsg_UpdatePermissions, 396 IPC_MESSAGE_CONTROL1(ExtensionMsg_UpdatePermissions,
378 int /* UpdateExtensionPermissionsInfo::REASON */, 397 ExtensionMsg_UpdatePermissions_Params)
379 std::string /* extension_id */,
380 extensions::APIPermissionSet /* permissions */,
381 extensions::URLPatternSet /* explicit_hosts */,
382 extensions::URLPatternSet /* scriptable_hosts */)
383 398
384 // Tell the renderer about new tab-specific permissions for an extension. 399 // Tell the renderer about new tab-specific permissions for an extension.
385 IPC_MESSAGE_CONTROL4(ExtensionMsg_UpdateTabSpecificPermissions, 400 IPC_MESSAGE_CONTROL4(ExtensionMsg_UpdateTabSpecificPermissions,
386 int32 /* page_id (only relevant for the target tab) */, 401 int32 /* page_id (only relevant for the target tab) */,
387 int /* tab_id */, 402 int /* tab_id */,
388 std::string /* extension_id */, 403 std::string /* extension_id */,
389 extensions::URLPatternSet /* hosts */) 404 extensions::URLPatternSet /* hosts */)
390 405
391 // Tell the renderer to clear tab-specific permissions for some extensions. 406 // Tell the renderer to clear tab-specific permissions for some extensions.
392 IPC_MESSAGE_CONTROL2(ExtensionMsg_ClearTabSpecificPermissions, 407 IPC_MESSAGE_CONTROL2(ExtensionMsg_ClearTabSpecificPermissions,
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 // Notifies the browser process that a tab has started or stopped matching 670 // Notifies the browser process that a tab has started or stopped matching
656 // certain conditions. This message is sent in response to several events: 671 // certain conditions. This message is sent in response to several events:
657 // 672 //
658 // * ExtensionMsg_WatchPages was received, updating the set of conditions. 673 // * ExtensionMsg_WatchPages was received, updating the set of conditions.
659 // * A new page is loaded. This will be sent after ViewHostMsg_FrameNavigate. 674 // * A new page is loaded. This will be sent after ViewHostMsg_FrameNavigate.
660 // Currently this only fires for the main frame. 675 // Currently this only fires for the main frame.
661 // * Something changed on an existing frame causing the set of matching searches 676 // * Something changed on an existing frame causing the set of matching searches
662 // to change. 677 // to change.
663 IPC_MESSAGE_ROUTED1(ExtensionHostMsg_OnWatchedPageChange, 678 IPC_MESSAGE_ROUTED1(ExtensionHostMsg_OnWatchedPageChange,
664 std::vector<std::string> /* Matching CSS selectors */) 679 std::vector<std::string> /* Matching CSS selectors */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698