Index: extensions/common/user_script.h |
diff --git a/extensions/common/user_script.h b/extensions/common/user_script.h |
index 6069161e8fb4dc0bd8e58c67163a473340bad339..e0de3f7e2af93a0c2fe2958d17e1cd915a2179ae 100644 |
--- a/extensions/common/user_script.h |
+++ b/extensions/common/user_script.h |
@@ -126,6 +126,19 @@ class UserScript { |
typedef std::vector<File> FileList; |
+ // Render's routing info of a <webview> that the user script will be injected |
+ // on. Only user scripts from <webview>s have a custom routing info. |
+ struct RoutingInfo { |
+ RoutingInfo() : render_process_id(-1), render_view_id(-1) {}; |
Nico
2015/03/04 15:35:01
nit: no ';' after method bodies
|
+ ~RoutingInfo() {}; |
Nico
2015/03/04 15:35:01
likewise
|
+ |
+ int render_process_id; |
+ int render_view_id; |
+ }; |
+ |
+ // Type of a API consumer instance that user scripts will be injected on. |
+ enum ConsumerInstanceType { TAB, WEBVIEW }; |
+ |
// Constructor. Default the run location to document end, which is like |
// Greasemonkey and probably more useful for typical scripts. |
UserScript(); |
@@ -200,6 +213,19 @@ class UserScript { |
const HostID& host_id() const { return host_id_; } |
void set_host_id(const HostID& host_id) { host_id_ = host_id; } |
+ const ConsumerInstanceType& consumer_instance_type() const { |
+ return consumer_instance_type_; |
+ } |
+ void set_consumer_instance_type( |
+ const ConsumerInstanceType& consumer_instance_type) { |
+ consumer_instance_type_ = consumer_instance_type; |
+ } |
+ |
+ const RoutingInfo& routing_info() const { return routing_info_; } |
+ void set_routing_info(const RoutingInfo& routing_info) { |
+ routing_info_ = routing_info; |
+ } |
+ |
int id() const { return user_script_id_; } |
void set_id(int id) { user_script_id_ = id; } |
@@ -226,6 +252,8 @@ class UserScript { |
void PickleGlobs(::Pickle* pickle, |
const std::vector<std::string>& globs) const; |
void PickleHostID(::Pickle* pickle, const HostID& host_id) const; |
+ void PickleRoutingInfo(::Pickle* pickle, |
+ const RoutingInfo& routing_info) const; |
void PickleURLPatternSet(::Pickle* pickle, |
const URLPatternSet& pattern_list) const; |
void PickleScripts(::Pickle* pickle, const FileList& scripts) const; |
@@ -236,6 +264,9 @@ class UserScript { |
void UnpickleHostID(const ::Pickle& pickle, |
PickleIterator* iter, |
HostID* host_id); |
+ void UnpickleRoutingInfo(const ::Pickle& pickle, |
+ PickleIterator* iter, |
+ RoutingInfo* routing_info); |
void UnpickleURLPatternSet(const ::Pickle& pickle, PickleIterator* iter, |
URLPatternSet* pattern_list); |
void UnpickleScripts(const ::Pickle& pickle, PickleIterator* iter, |
@@ -278,6 +309,12 @@ class UserScript { |
// |host_id| can be empty if the script is a "standlone" user script. |
HostID host_id_; |
+ // The type of the consumer instance that the script will be injected. |
+ ConsumerInstanceType consumer_instance_type_; |
+ |
+ // The render side's rounting info for content_scripts of <webview>. |
+ RoutingInfo routing_info_; |
Nico
2015/03/05 00:40:11
You don't initialize this in the constructor, whic
Devlin
2015/03/05 00:42:49
This comment refers to the variable on line 313. :
Nico
2015/03/05 00:45:10
Duh, yes, sorry :-(
|
+ |
// The globally-unique id associated with this user script. Defaults to |
// -1 for invalid. |
int user_script_id_; |