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

Unified Diff: chrome/common/extensions/extension_messages.h

Issue 7432006: Add an experimental permissions API for extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 5 months 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 side-by-side diff with in-line comments
Download patch
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 */)

Powered by Google App Engine
This is Rietveld 408576698