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

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

Issue 14651017: Move RuntimeData and related permissions out of Extension class (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_unref_permissions
Patch Set: Latest master Created 7 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 534275daaf9551dca6e18f5cde818e63f423bc71..cd14549ec510b0174d158007e3ac3532c0dfa7be 100644
--- a/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc
+++ b/chrome/common/extensions/manifest_handlers/content_scripts_handler.cc
@@ -13,6 +13,7 @@
#include "base/values.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
+#include "chrome/common/extensions/permissions/permissions_data.h"
#include "content/public/common/url_constants.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/extension_resource.h"
@@ -136,7 +137,7 @@ bool LoadUserScriptFromDictionary(const DictionaryValue* content_script,
}
URLPattern pattern(UserScript::ValidUserScriptSchemes(
- extension->CanExecuteScriptEverywhere()));
+ PermissionsData::CanExecuteScriptEverywhere(extension)));
URLPattern::ParseResult parse_result = pattern.Parse(match_str);
if (parse_result != URLPattern::PARSE_SUCCESS) {
@@ -149,7 +150,7 @@ bool LoadUserScriptFromDictionary(const DictionaryValue* content_script,
}
// TODO(aboxhall): check for webstore
- if (!extension->CanExecuteScriptEverywhere() &&
+ if (!PermissionsData::CanExecuteScriptEverywhere(extension) &&
pattern.scheme() != chrome::kChromeUIScheme) {
// Exclude SCHEME_CHROMEUI unless it's been explicitly requested.
// If the --extensions-on-chrome-urls flag has not been passed, requesting
@@ -160,7 +161,7 @@ bool LoadUserScriptFromDictionary(const DictionaryValue* content_script,
}
if (pattern.MatchesScheme(chrome::kFileScheme) &&
- !extension->CanExecuteScriptEverywhere()) {
+ !PermissionsData::CanExecuteScriptEverywhere(extension)) {
extension->set_wants_file_access(true);
if (!(extension->creation_flags() & Extension::ALLOW_FILE_ACCESS)) {
pattern.SetValidSchemes(
@@ -193,7 +194,7 @@ bool LoadUserScriptFromDictionary(const DictionaryValue* content_script,
}
int valid_schemes = UserScript::ValidUserScriptSchemes(
- extension->CanExecuteScriptEverywhere());
+ PermissionsData::CanExecuteScriptEverywhere(extension));
URLPattern pattern(valid_schemes);
URLPattern::ParseResult parse_result = pattern.Parse(match_str);

Powered by Google App Engine
This is Rietveld 408576698