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) |