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

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

Issue 7574017: Make extension file URL access opt-in. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 5c05c6cb9b16dba738258e193fd3224aac37b1c0..0ac80c7e2a60e87303d70c68766b5ba9dc1f6ad7 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -304,12 +304,7 @@ void ExtensionServiceBackend::CheckExtensionFileAccess(
const FilePath& extension_path, bool prompt_for_plugins) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
std::string id = Extension::GenerateIdForPath(extension_path);
- // 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);
+ bool allow_file_access = frontend_->extension_prefs()->AllowFileAccess(id);
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
NewRunnableMethod(
@@ -1034,13 +1029,9 @@ void ExtensionService::LoadExtensionFromCommandLine(
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 (allow_file_access)
+ if (extension_prefs()->AllowFileAccess(id))
flags |= Extension::ALLOW_FILE_ACCESS;
if (Extension::ShouldDoStrictErrorChecking(Extension::LOAD))
flags |= Extension::STRICT_ERROR_CHECKS;
@@ -2205,13 +2196,6 @@ void ExtensionService::OnExtensionInstalled(
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);
asargent_no_longer_on_chrome 2011/08/04 21:56:03 Ah, I guess this is the actual location of the bug
jstritar 2011/08/05 15:13:29 Yep. The ShouldAlwaysAllowFileAccess method seemed
- }
-
NotificationService::current()->Notify(
chrome::NOTIFICATION_EXTENSION_INSTALLED,
Source<Profile>(profile_),

Powered by Google App Engine
This is Rietveld 408576698