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

Side by Side Diff: chrome/common/extensions/manifest_handlers/content_scripts_handler.cc

Issue 273193004: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/extensions/manifest_handlers/content_scripts_handler.h" 5 #include "chrome/common/extensions/manifest_handlers/content_scripts_handler.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 if (!PermissionsData::CanExecuteScriptEverywhere(extension) && 153 if (!PermissionsData::CanExecuteScriptEverywhere(extension) &&
154 pattern.scheme() != content::kChromeUIScheme) { 154 pattern.scheme() != content::kChromeUIScheme) {
155 // Exclude SCHEME_CHROMEUI unless it's been explicitly requested. 155 // Exclude SCHEME_CHROMEUI unless it's been explicitly requested.
156 // If the --extensions-on-chrome-urls flag has not been passed, requesting 156 // If the --extensions-on-chrome-urls flag has not been passed, requesting
157 // a chrome:// url will cause a parse failure above, so there's no need to 157 // a chrome:// url will cause a parse failure above, so there's no need to
158 // check the flag here. 158 // check the flag here.
159 pattern.SetValidSchemes( 159 pattern.SetValidSchemes(
160 pattern.valid_schemes() & ~URLPattern::SCHEME_CHROMEUI); 160 pattern.valid_schemes() & ~URLPattern::SCHEME_CHROMEUI);
161 } 161 }
162 162
163 if (pattern.MatchesScheme(content::kFileScheme) && 163 if (pattern.MatchesScheme(url::kFileScheme) &&
164 !PermissionsData::CanExecuteScriptEverywhere(extension)) { 164 !PermissionsData::CanExecuteScriptEverywhere(extension)) {
165 extension->set_wants_file_access(true); 165 extension->set_wants_file_access(true);
166 if (!(extension->creation_flags() & Extension::ALLOW_FILE_ACCESS)) { 166 if (!(extension->creation_flags() & Extension::ALLOW_FILE_ACCESS)) {
167 pattern.SetValidSchemes( 167 pattern.SetValidSchemes(
168 pattern.valid_schemes() & ~URLPattern::SCHEME_FILE); 168 pattern.valid_schemes() & ~URLPattern::SCHEME_FILE);
169 } 169 }
170 } 170 }
171 171
172 result->add_url_pattern(pattern); 172 result->add_url_pattern(pattern);
173 } 173 }
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 if (!IsScriptValid(path, css_script.relative_path(), 459 if (!IsScriptValid(path, css_script.relative_path(),
460 IDS_EXTENSION_LOAD_CSS_FAILED, error)) 460 IDS_EXTENSION_LOAD_CSS_FAILED, error))
461 return false; 461 return false;
462 } 462 }
463 } 463 }
464 464
465 return true; 465 return true;
466 } 466 }
467 467
468 } // namespace extensions 468 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698