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

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

Issue 6772022: Make <all_urls> and file:///* in permissions trigger "Allow file access" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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 | chrome/browser/extensions/extensions_ui.cc » ('j') | chrome/common/extensions/extension.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index cb99385e0b63c712df2dfdb05cd0a57f8bf18636..352b4c2613379295586611f94b8ccb78e31081cf 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -199,7 +199,8 @@ void ExtensionServiceBackend::LoadSingleExtension(
FilePath extension_path = path_in;
file_util::AbsolutePath(&extension_path);
- int flags = Extension::NO_FLAGS;
+ int flags = Extension::ShouldAlwaysAllowFileAccess(Extension::LOAD) ?
+ Extension::ALLOW_FILE_ACCESS : Extension::NO_FLAGS;
if (Extension::ShouldDoStrictErrorChecking(Extension::LOAD))
flags |= Extension::STRICT_ERROR_CHECKS;
std::string error;
@@ -798,6 +799,8 @@ void ExtensionService::LoadAllExtensions() {
int flags = Extension::NO_FLAGS;
if (Extension::ShouldDoStrictErrorChecking(info->extension_location))
flags |= Extension::STRICT_ERROR_CHECKS;
+ if (extension_prefs_->AllowFileAccess(info->extension_id))
+ flags |= Extension::ALLOW_FILE_ACCESS;
std::string error;
scoped_refptr<const Extension> extension(
extension_file_util::LoadExtension(
@@ -922,6 +925,8 @@ void ExtensionService::LoadInstalledExtension(const ExtensionInfo& info,
flags |= Extension::REQUIRE_KEY;
if (Extension::ShouldDoStrictErrorChecking(info.extension_location))
flags |= Extension::STRICT_ERROR_CHECKS;
+ if (extension_prefs_->AllowFileAccess(info.extension_id))
+ flags |= Extension::ALLOW_FILE_ACCESS;
extension = Extension::Create(
info.extension_path,
info.extension_location,
@@ -1494,9 +1499,7 @@ void ExtensionService::OnExtensionInstalled(const Extension* extension) {
extension_prefs_->OnExtensionInstalled(
extension, initial_state, initial_enable_incognito);
- // Unpacked extensions start off with file access since they are a developer
- // feature.
- if (extension->location() == Extension::LOAD)
+ if (Extension::ShouldAlwaysAllowFileAccess(Extension::LOAD))
extension_prefs_->SetAllowFileAccess(extension->id(), true);
// If the extension is a theme, tell the profile (and therefore ThemeProvider)
« no previous file with comments | « no previous file | chrome/browser/extensions/extensions_ui.cc » ('j') | chrome/common/extensions/extension.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698