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

Unified Diff: chrome/renderer/user_script_slave.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: Patch for landing 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/renderer/user_script_slave.cc
diff --git a/chrome/renderer/user_script_slave.cc b/chrome/renderer/user_script_slave.cc
index 7581b402c1c1577a77d64d76f5ed0eb08c18bbb2..0ad117fff3f6d9f38d952f02f5d39114da97c77a 100644
--- a/chrome/renderer/user_script_slave.cc
+++ b/chrome/renderer/user_script_slave.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -151,12 +151,8 @@ bool UserScriptSlave::UpdateScripts(base::SharedMemoryHandle shared_memory) {
std::vector<URLPattern> explicit_patterns =
script->url_patterns()[k].ConvertToExplicitSchemes();
for (size_t m = 0; m < explicit_patterns.size(); ++m) {
- // Only include file schemes if the user has opted into that.
- if (!explicit_patterns[m].MatchesScheme(chrome::kFileScheme) ||
- script->allow_file_access()) {
- temp_patterns.push_back(WebString::fromUTF8(
- explicit_patterns[m].GetAsString()));
- }
+ temp_patterns.push_back(WebString::fromUTF8(
+ explicit_patterns[m].GetAsString()));
}
}
patterns.assign(temp_patterns);
@@ -214,9 +210,6 @@ void UserScriptSlave::InjectScripts(WebFrame* frame,
if (!extension->CanExecuteScriptOnPage(frame_url, script, NULL))
continue;
- if (frame_url.SchemeIsFile() && !script->allow_file_access())
- continue; // This script isn't allowed to run on file URLs.
-
// We rely on WebCore for CSS injection, but it's still useful to know how
// many css files there are.
if (location == UserScript::DOCUMENT_START)
« no previous file with comments | « chrome/common/extensions/user_script.cc ('k') | chrome/test/data/extensions/permissions/content_script_all_urls.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698