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

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: Refactoring, minor changes 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..de9e7c537740a005b5c334d83f99d2e566aaa248 100644
--- a/chrome/browser/extensions/active_tab_permission_granter.cc
+++ b/chrome/browser/extensions/active_tab_permission_granter.cc
@@ -47,12 +47,9 @@ 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);
- }
+ // Origin adding could fail if this is an unsupported URL e.g. chrome://.
not at google - send to devlin 2014/08/12 19:49:27 comment isn't for here (it should be inside the Ad
gpdavis 2014/08/12 21:19:55 Done.
+ new_hosts.AddOrigin(UserScript::ValidUserScriptSchemes(),
+ web_contents()->GetURL().GetOrigin());
not at google - send to devlin 2014/08/12 19:49:27 cleanup: use GetVisibleURL() here.
gpdavis 2014/08/12 21:19:54 Done.
new_apis.insert(APIPermission::kTab);
}

Powered by Google App Engine
This is Rietveld 408576698