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

Unified Diff: extensions/common/user_script.h

Issue 313453002: Resubmit: Block content scripts from executing until user grants permission (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest master Created 6 years, 7 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
« no previous file with comments | « extensions/common/permissions/permissions_data.cc ('k') | extensions/common/user_script.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/user_script.h
diff --git a/extensions/common/user_script.h b/extensions/common/user_script.h
index 05974c7fa4db6359e50c30a4e67339da9cc644c9..9165e621865397f2aceb8cd9ba889a64133f5e61 100644
--- a/extensions/common/user_script.h
+++ b/extensions/common/user_script.h
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/basictypes.h"
#include "base/files/file_path.h"
#include "base/strings/string_piece.h"
#include "extensions/common/url_pattern.h"
@@ -45,6 +46,8 @@ class UserScript {
// is "idle". Currently this uses the simple heuristic of:
// min(DOM_CONTENT_LOADED + TIMEOUT, ONLOAD), but no
// particular injection point is guaranteed.
+ RUN_DEFERRED, // The user script's injection was deferred for permissions
+ // reasons, and was executed at a later time.
RUN_LOCATION_LAST // Leave this as the last item.
};
@@ -174,6 +177,9 @@ class UserScript {
const std::string& extension_id() const { return extension_id_; }
void set_extension_id(const std::string& id) { extension_id_ = id; }
+ int64 id() const { return user_script_id_; }
+ void set_id(int64 id) { user_script_id_ = id; }
+
bool is_incognito_enabled() const { return incognito_enabled_; }
void set_incognito_enabled(bool enabled) { incognito_enabled_ = enabled; }
@@ -245,6 +251,10 @@ class UserScript {
// the script is a "standlone" user script.
std::string extension_id_;
+ // The globally-unique id associated with this user script. Defaults to
+ // -1 for invalid.
+ int64 user_script_id_;
+
// Whether we should try to emulate Greasemonkey's APIs when running this
// script.
bool emulate_greasemonkey_;
« no previous file with comments | « extensions/common/permissions/permissions_data.cc ('k') | extensions/common/user_script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698