diff options
Diffstat (limited to 'chrome/common/extensions/extension_messages.h')
-rw-r--r-- | chrome/common/extensions/extension_messages.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/chrome/common/extensions/extension_messages.h b/chrome/common/extensions/extension_messages.h index 53abba6..6d41b9c 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; @@ -135,6 +146,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); @@ -214,6 +233,13 @@ 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 */) |