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

Unified Diff: chrome/common/extensions/manifest_handlers/content_scripts_handler.cc

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
Index: chrome/common/extensions/manifest_handlers/content_scripts_handler.cc
diff --git a/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc b/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc
index 5ca9f9af2275696e7e7645248e846b1358daefa4..6cb936b6bb4b0ac4fe13da97696e1c2fadad3b36 100644
--- a/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc
+++ b/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc
@@ -31,6 +31,9 @@ namespace errors = manifest_errors;
namespace {
+// The globally-unique id for a user script.
+int64 g_next_user_script_id = 0;
+
// Helper method that loads either the include_globs or exclude_globs list
// from an entry in the content_script lists of the manifest.
bool LoadGlobsHelper(const base::DictionaryValue* content_script,
@@ -424,6 +427,7 @@ bool ContentScriptsHandler::Parse(Extension* extension, base::string16* error) {
// Greasemonkey matches all frames.
user_script.set_match_all_frames(true);
}
+ user_script.set_id(g_next_user_script_id++);
content_scripts_info->content_scripts.push_back(user_script);
}
extension->SetManifestData(keys::kContentScripts,

Powered by Google App Engine
This is Rietveld 408576698