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

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

Issue 24170002: Allow tab permission to be granted for chrome:// pages through activeTab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: typo Created 7 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d6bce7eedcba00f0c274fa2d477c64bec66dcaf4..8e8c1dcc917872d4d66b3f15749786965167748e 100644
--- a/chrome/browser/extensions/active_tab_permission_granter.cc
+++ b/chrome/browser/extensions/active_tab_permission_granter.cc
@@ -49,15 +49,15 @@ void ActiveTabPermissionGranter::GrantIfRequested(const Extension* extension) {
if (pattern.Parse(web_contents()->GetURL().spec()) ==
URLPattern::PARSE_SUCCESS) {
new_hosts.AddPattern(pattern);
- new_apis.insert(APIPermission::kTab);
- granted_extensions_.Insert(extension);
}
+ new_apis.insert(APIPermission::kTab);
}
if (extension->HasAPIPermission(APIPermission::kTabCapture))
new_apis.insert(APIPermission::kTabCaptureForTab);
- if (!new_apis.empty()) {
+ if (!new_apis.empty() || !new_hosts.is_empty()) {
+ granted_extensions_.Insert(extension);
scoped_refptr<const PermissionSet> new_permissions =
new PermissionSet(new_apis, new_hosts, URLPatternSet());
PermissionsData::UpdateTabSpecificPermissions(extension,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698