summaryrefslogtreecommitdiffstats
path: root/extensions/common/extension_messages.h
diff options
context:
space:
mode:
authorhanxi <hanxi@chromium.org>2015-03-09 13:46:59 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-09 20:47:49 +0000
commit79f7a57302cae3f7afcd53c6dff542e32bada999 (patch)
treeffa0c8be372fff6f9c02f7a83e05928cb6472c65 /extensions/common/extension_messages.h
parent7b41c6561705c1645d65313d116f35c582bd6247 (diff)
downloadchromium_src-79f7a57302cae3f7afcd53c6dff542e32bada999.zip
chromium_src-79f7a57302cae3f7afcd53c6dff542e32bada999.tar.gz
chromium_src-79f7a57302cae3f7afcd53c6dff542e32bada999.tar.bz2
Enable <webview>.executeScript outside of Apps and Extensions [1]
This patch enables javascript code injection like <webview>.executeScript({code: ...}), but does not include file injection like <webview>.executeScript({file: ...}). File injection will be in another patch. BUG=434081 Review URL: https://codereview.chromium.org/942533003 Cr-Commit-Position: refs/heads/master@{#319727}
Diffstat (limited to 'extensions/common/extension_messages.h')
-rw-r--r--extensions/common/extension_messages.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/extensions/common/extension_messages.h b/extensions/common/extension_messages.h
index aee505c..232167c 100644
--- a/extensions/common/extension_messages.h
+++ b/extensions/common/extension_messages.h
@@ -16,6 +16,7 @@
#include "extensions/common/draggable_region.h"
#include "extensions/common/extension.h"
#include "extensions/common/extensions_client.h"
+#include "extensions/common/host_id.h"
#include "extensions/common/permissions/media_galleries_permission_data.h"
#include "extensions/common/permissions/permission_set.h"
#include "extensions/common/permissions/socket_permission_data.h"
@@ -38,6 +39,8 @@ IPC_ENUM_TRAITS_MAX_VALUE(content::SocketPermissionRequest::OperationType,
IPC_ENUM_TRAITS_MAX_VALUE(extensions::UserScript::InjectionType,
extensions::UserScript::INJECTION_TYPE_LAST)
+IPC_ENUM_TRAITS_MAX_VALUE(HostID::HostType, HostID::HOST_TYPE_LAST)
+
// Parameters structure for ExtensionHostMsg_AddAPIActionToActivityLog and
// ExtensionHostMsg_AddEventToActivityLog.
IPC_STRUCT_BEGIN(ExtensionHostMsg_APIActionOrEvent_Params)
@@ -106,9 +109,8 @@ IPC_STRUCT_BEGIN(ExtensionMsg_ExecuteCode_Params)
// The extension API request id, for responding.
IPC_STRUCT_MEMBER(int, request_id)
- // The ID of the requesting extension. To know which isolated world to
- // execute the code inside of.
- IPC_STRUCT_MEMBER(std::string, extension_id)
+ // The ID of the requesting injection host.
+ IPC_STRUCT_MEMBER(HostID, host_id)
// Whether the code is JavaScript or CSS.
IPC_STRUCT_MEMBER(bool, is_javascript)
@@ -338,6 +340,14 @@ struct ParamTraits<extensions::ManifestPermissionSet> {
};
template <>
+struct ParamTraits<HostID> {
+ typedef HostID param_type;
+ static void Write(Message* m, const param_type& p);
+ static bool Read(const Message* m, PickleIterator* iter, param_type* r);
+ static void Log(const param_type& p, std::string* l);
+};
+
+template <>
struct ParamTraits<ExtensionMsg_PermissionSetStruct> {
typedef ExtensionMsg_PermissionSetStruct param_type;
static void Write(Message* m, const param_type& p);