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

Unified Diff: chrome/browser/extensions/extensions_ui.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: Fix ExtensionModuleApiTest.(In)CognitoNoFile. 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
Index: chrome/browser/extensions/extensions_ui.cc
diff --git a/chrome/browser/extensions/extensions_ui.cc b/chrome/browser/extensions/extensions_ui.cc
index 9f326f77ed6b5c01ea47d79eaa57cefa73e831e7..2b281887f794fcd4eb027b4665108d731539a47e 100644
--- a/chrome/browser/extensions/extensions_ui.cc
+++ b/chrome/browser/extensions/extensions_ui.cc
@@ -692,20 +692,6 @@ DictionaryValue* ExtensionsDOMHandler::CreateContentScriptDetailValue(
return script_data;
}
-static bool ExtensionWantsFileAccess(const Extension* extension) {
- for (UserScriptList::const_iterator it = extension->content_scripts().begin();
- it != extension->content_scripts().end(); ++it) {
- for (UserScript::PatternList::const_iterator pattern =
- it->url_patterns().begin();
- pattern != it->url_patterns().end(); ++pattern) {
- if (pattern->MatchesScheme(chrome::kFileScheme))
- return true;
- }
- }
-
- return false;
-}
-
// Static
DictionaryValue* ExtensionsDOMHandler::CreateExtensionDetailValue(
ExtensionService* service, const Extension* extension,
@@ -725,8 +711,7 @@ DictionaryValue* ExtensionsDOMHandler::CreateExtensionDetailValue(
extension_data->SetBoolean("terminated", terminated);
extension_data->SetBoolean("enabledIncognito",
service ? service->IsIncognitoEnabled(extension) : false);
- extension_data->SetBoolean("wantsFileAccess",
- ExtensionWantsFileAccess(extension));
+ extension_data->SetBoolean("wantsFileAccess", extension->wants_file_access());
extension_data->SetBoolean("allowFileAccess",
service ? service->AllowFileAccess(extension) : false);
extension_data->SetBoolean("allow_reload",

Powered by Google App Engine
This is Rietveld 408576698