Commit f5989dee authored by Karan Bhatia's avatar Karan Bhatia Committed by Commit Bot

Extensions Page: Show "Allow access to file URLs" setting for unpacked extensions.

By default, all unpacked extensions are granted file access. However, if the
extension did not request scriptable or host permissions for the same, we don't
show the "Allow access to file URLs" checkbox for the extension on the
chrome://extensions page.

This CL resolves this discrepancy by modifying the condition to show the file
access checkbox, to also take care of the unpacked extension case.

BUG=830112
TEST=Load an unpacked extension on chrome with no host or scripting permissions.
Open chrome://extensions. Ensure that "Allow access to file URLs" checkbox is
shown for the extension and is checked. Do this both for the old and the MD
Extensions page.

Change-Id: Idbb1deae88448f390576fb39ed18876314848f13
Reviewed-on: https://chromium-review.googlesource.com/1006196
Commit-Queue: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550535}
parent 664c3ca7
...@@ -402,7 +402,8 @@ void ExtensionInfoGenerator::CreateExtensionInfoHelper( ...@@ -402,7 +402,8 @@ void ExtensionInfoGenerator::CreateExtensionInfoHelper(
// File access. // File access.
ManagementPolicy* management_policy = extension_system_->management_policy(); ManagementPolicy* management_policy = extension_system_->management_policy();
info->file_access.is_enabled = info->file_access.is_enabled =
extension.wants_file_access() && (extension.wants_file_access() ||
Manifest::ShouldAlwaysAllowFileAccess(extension.location())) &&
management_policy->UserMayModifySettings(&extension, nullptr); management_policy->UserMayModifySettings(&extension, nullptr);
info->file_access.is_active = info->file_access.is_active =
util::AllowFileAccess(extension.id(), browser_context_); util::AllowFileAccess(extension.id(), browser_context_);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
}, },
"fileAccess": { "fileAccess": {
"isActive": true, "isActive": true,
"isEnabled": false "isEnabled": true
}, },
"homePage": { "homePage": {
"specified": false, "specified": false,
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
}, },
"fileAccess": { "fileAccess": {
"isActive": true, "isActive": true,
"isEnabled": false "isEnabled": true
}, },
"homePage": { "homePage": {
"specified": false, "specified": false,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment