Index: chrome/browser/extensions/extension_service.cc |
=================================================================== |
--- chrome/browser/extensions/extension_service.cc (revision 95819) |
+++ chrome/browser/extensions/extension_service.cc (working copy) |
@@ -304,7 +304,12 @@ |
const FilePath& extension_path, bool prompt_for_plugins) { |
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
std::string id = Extension::GenerateIdForPath(extension_path); |
- bool allow_file_access = frontend_->extension_prefs()->AllowFileAccess(id); |
+ // Unpacked extensions default to allowing file access, but if that has been |
+ // overridden, don't reset the value. |
+ bool allow_file_access = |
+ Extension::ShouldAlwaysAllowFileAccess(Extension::LOAD); |
+ if (frontend_->extension_prefs()->HasAllowFileAccessSetting(id)) |
+ allow_file_access = frontend_->extension_prefs()->AllowFileAccess(id); |
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
NewRunnableMethod( |
@@ -1029,9 +1034,13 @@ |
file_util::AbsolutePath(&extension_path); |
std::string id = Extension::GenerateIdForPath(extension_path); |
+ bool allow_file_access = |
+ Extension::ShouldAlwaysAllowFileAccess(Extension::LOAD); |
+ if (extension_prefs()->HasAllowFileAccessSetting(id)) |
+ allow_file_access = extension_prefs()->AllowFileAccess(id); |
int flags = Extension::NO_FLAGS; |
- if (extension_prefs()->AllowFileAccess(id)) |
+ if (allow_file_access) |
flags |= Extension::ALLOW_FILE_ACCESS; |
if (Extension::ShouldDoStrictErrorChecking(Extension::LOAD)) |
flags |= Extension::STRICT_ERROR_CHECKS; |
@@ -2196,6 +2205,13 @@ |
initial_enable ? Extension::ENABLED : Extension::DISABLED, |
from_webstore); |
+ // Unpacked extensions default to allowing file access, but if that has been |
+ // overridden, don't reset the value. |
+ if (Extension::ShouldAlwaysAllowFileAccess(Extension::LOAD) && |
+ !extension_prefs_->HasAllowFileAccessSetting(id)) { |
+ extension_prefs_->SetAllowFileAccess(id, true); |
+ } |
+ |
NotificationService::current()->Notify( |
chrome::NOTIFICATION_EXTENSION_INSTALLED, |
Source<Profile>(profile_), |