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

Unified Diff: chrome/browser/extensions/active_tab_permission_granter.cc

Issue 396033002: Support "always allow" for runtime script execution (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ReloadExtension in unittest Created 6 years, 4 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/browser/extensions/active_tab_permission_granter.cc
diff --git a/chrome/browser/extensions/active_tab_permission_granter.cc b/chrome/browser/extensions/active_tab_permission_granter.cc
index 608eaa171c31549c8176b39df6c3d9ebb9ef7a7e..2f80ad7dbc287f57d2d6afc2ccd8dd4273b12119 100644
--- a/chrome/browser/extensions/active_tab_permission_granter.cc
+++ b/chrome/browser/extensions/active_tab_permission_granter.cc
@@ -47,12 +47,8 @@ void ActiveTabPermissionGranter::GrantIfRequested(const Extension* extension) {
// permission in the manifest.
if (permissions_data->HasAPIPermission(APIPermission::kActiveTab) ||
permissions_data->HasWithheldImpliedAllHosts()) {
- URLPattern pattern(UserScript::ValidUserScriptSchemes());
- // Pattern parsing could fail if this is an unsupported URL e.g. chrome://.
- if (pattern.Parse(web_contents()->GetURL().spec()) ==
- URLPattern::PARSE_SUCCESS) {
- new_hosts.AddPattern(pattern);
- }
+ new_hosts.AddOrigin(UserScript::ValidUserScriptSchemes(),
+ web_contents()->GetVisibleURL().GetOrigin());
new_apis.insert(APIPermission::kTab);
}

Powered by Google App Engine
This is Rietveld 408576698