OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // IPC_MESSAGE macros choke on extra , in the std::map, when expanding. We need | 95 // IPC_MESSAGE macros choke on extra , in the std::map, when expanding. We need |
96 // to typedef it to avoid that. | 96 // to typedef it to avoid that. |
97 // Substitution map for l10n messages. | 97 // Substitution map for l10n messages. |
98 typedef std::map<std::string, std::string> SubstitutionMap; | 98 typedef std::map<std::string, std::string> SubstitutionMap; |
99 | 99 |
100 struct ExtensionMsg_Loaded_Params { | 100 struct ExtensionMsg_Loaded_Params { |
101 ExtensionMsg_Loaded_Params(); | 101 ExtensionMsg_Loaded_Params(); |
102 ~ExtensionMsg_Loaded_Params(); | 102 ~ExtensionMsg_Loaded_Params(); |
103 explicit ExtensionMsg_Loaded_Params(const Extension* extension); | 103 explicit ExtensionMsg_Loaded_Params(const Extension* extension); |
104 | 104 |
105 // A copy constructor is needed because this structure can end up getting | |
106 // copied inside the IPC machinery on gcc <= 4.2. | |
107 ExtensionMsg_Loaded_Params(const ExtensionMsg_Loaded_Params& other); | |
108 | |
109 // Creates a new extension from the data in this object. | 105 // Creates a new extension from the data in this object. |
110 scoped_refptr<Extension> ConvertToExtension() const; | 106 scoped_refptr<Extension> ConvertToExtension() const; |
111 | 107 |
112 // The subset of the extension manifest data we send to renderers. | 108 // The subset of the extension manifest data we send to renderers. |
113 linked_ptr<DictionaryValue> manifest; | 109 linked_ptr<DictionaryValue> manifest; |
114 | 110 |
115 // The location the extension was installed from. | 111 // The location the extension was installed from. |
116 Extension::Location location; | 112 Extension::Location location; |
117 | 113 |
118 // The path the extension was loaded from. This is used in the renderer only | 114 // The path the extension was loaded from. This is used in the renderer only |
119 // to generate the extension ID for extensions that are loaded unpacked. | 115 // to generate the extension ID for extensions that are loaded unpacked. |
120 FilePath path; | 116 FilePath path; |
121 | 117 |
122 // The extension's current active permissions. | |
123 ExtensionAPIPermissionSet apis; | |
124 URLPatternSet explicit_hosts; | |
125 URLPatternSet scriptable_hosts; | |
126 | |
127 // We keep this separate so that it can be used in logging. | 118 // We keep this separate so that it can be used in logging. |
128 std::string id; | 119 std::string id; |
129 | 120 |
130 // Send creation flags so extension is initialized identically. | 121 // Send creation flags so extension is initialized identically. |
131 int creation_flags; | 122 int creation_flags; |
132 }; | 123 }; |
133 | 124 |
134 namespace IPC { | 125 namespace IPC { |
135 | 126 |
136 template <> | 127 template <> |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 // Response to the renderer for the above message. | 358 // Response to the renderer for the above message. |
368 IPC_MESSAGE_ROUTED3(ExtensionMsg_GetAppNotifyChannelResponse, | 359 IPC_MESSAGE_ROUTED3(ExtensionMsg_GetAppNotifyChannelResponse, |
369 std::string /* channel_id */, | 360 std::string /* channel_id */, |
370 std::string /* error */, | 361 std::string /* error */, |
371 int32 /* callback_id */) | 362 int32 /* callback_id */) |
372 | 363 |
373 // Deliver a message sent with ExtensionHostMsg_PostMessage. | 364 // Deliver a message sent with ExtensionHostMsg_PostMessage. |
374 IPC_MESSAGE_ROUTED2(ExtensionMsg_DeliverMessage, | 365 IPC_MESSAGE_ROUTED2(ExtensionMsg_DeliverMessage, |
375 int /* target_port_id */, | 366 int /* target_port_id */, |
376 std::string /* message */) | 367 std::string /* message */) |
OLD | NEW |