| Index: chrome/common/extensions/extension_messages.h
|
| diff --git a/chrome/common/extensions/extension_messages.h b/chrome/common/extensions/extension_messages.h
|
| index 6a4318d9280c44d4e08c7cf4d011f8999bac265d..4b93d4c6c29820393e22d0b482a8ad25e3cbe079 100644
|
| --- a/chrome/common/extensions/extension_messages.h
|
| +++ b/chrome/common/extensions/extension_messages.h
|
| @@ -8,6 +8,7 @@
|
| #include "base/shared_memory.h"
|
| #include "base/values.h"
|
| #include "chrome/common/extensions/extension.h"
|
| +#include "chrome/common/extensions/extension_permission_set.h"
|
| #include "chrome/common/extensions/url_pattern.h"
|
| #include "chrome/common/extensions/url_pattern_set.h"
|
| #include "chrome/common/web_apps.h"
|
| @@ -90,7 +91,9 @@ typedef std::map<std::string, std::string> SubstitutionMap;
|
| struct ExtensionMsg_Loaded_Params {
|
| ExtensionMsg_Loaded_Params();
|
| ~ExtensionMsg_Loaded_Params();
|
| - explicit ExtensionMsg_Loaded_Params(const Extension* extension);
|
| + explicit ExtensionMsg_Loaded_Params(
|
| + const Extension* extension,
|
| + const ExtensionPermissionSet* active_permissions);
|
|
|
| // A copy constructor is needed because this structure can end up getting
|
| // copied inside the IPC machinery on gcc <= 4.2.
|
| @@ -99,6 +102,9 @@ struct ExtensionMsg_Loaded_Params {
|
| // Creates a new extension from the data in this object.
|
| scoped_refptr<Extension> ConvertToExtension() const;
|
|
|
| + // Passes ownership to the caller.
|
| + const ExtensionPermissionSet* GetActivePermissions() const;
|
| +
|
| // The subset of the extension manifest data we send to renderers.
|
| scoped_ptr<DictionaryValue> manifest;
|
|
|
| @@ -109,6 +115,11 @@ struct ExtensionMsg_Loaded_Params {
|
| // to generate the extension ID for extensions that are loaded unpacked.
|
| FilePath path;
|
|
|
| + // The extension's current active permissions.
|
| + ExtensionAPIPermissionSet apis;
|
| + URLPatternSet explicit_hosts;
|
| + URLPatternSet scriptable_hosts;
|
| +
|
| // We keep this separate so that it can be used in logging.
|
| std::string id;
|
| };
|
| @@ -132,6 +143,14 @@ struct ParamTraits<URLPatternSet> {
|
| };
|
|
|
| template <>
|
| +struct ParamTraits<ExtensionAPIPermission::ID> {
|
| + typedef ExtensionAPIPermission::ID param_type;
|
| + static void Write(Message* m, const param_type& p);
|
| + static bool Read(const Message* m, void** iter, param_type* p);
|
| + static void Log(const param_type& p, std::string* l);
|
| +};
|
| +
|
| +template <>
|
| struct ParamTraits<ExtensionMsg_Loaded_Params> {
|
| typedef ExtensionMsg_Loaded_Params param_type;
|
| static void Write(Message* m, const param_type& p);
|
| @@ -211,6 +230,12 @@ IPC_MESSAGE_ROUTED1(ExtensionMsg_GetApplicationInfo,
|
| IPC_MESSAGE_ROUTED1(ExtensionMsg_UpdateBrowserWindowId,
|
| int /* id of browser window */)
|
|
|
| +// Tell the renderer to update an extension's permission set.
|
| +IPC_MESSAGE_CONTROL4(ExtensionMsg_UpdatePermissions,
|
| + std::string /* extension_id*/,
|
| + ExtensionAPIPermissionSet,
|
| + URLPatternSet,
|
| + URLPatternSet)
|
| // Tell the renderer which type this view is.
|
| IPC_MESSAGE_ROUTED1(ExtensionMsg_NotifyRenderViewType,
|
| ViewType::Type /* view_type */)
|
|
|