| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extension_file_util.h" | 5 #include "chrome/common/extensions/extension_file_util.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 // and are UTF-8 encoded. | 265 // and are UTF-8 encoded. |
| 266 ExtensionResource::SymlinkPolicy symlink_policy; | 266 ExtensionResource::SymlinkPolicy symlink_policy; |
| 267 if ((extension->creation_flags() & | 267 if ((extension->creation_flags() & |
| 268 Extension::FOLLOW_SYMLINKS_ANYWHERE) != 0) { | 268 Extension::FOLLOW_SYMLINKS_ANYWHERE) != 0) { |
| 269 symlink_policy = ExtensionResource::FOLLOW_SYMLINKS_ANYWHERE; | 269 symlink_policy = ExtensionResource::FOLLOW_SYMLINKS_ANYWHERE; |
| 270 } else { | 270 } else { |
| 271 symlink_policy = ExtensionResource::SYMLINKS_MUST_RESOLVE_WITHIN_ROOT; | 271 symlink_policy = ExtensionResource::SYMLINKS_MUST_RESOLVE_WITHIN_ROOT; |
| 272 } | 272 } |
| 273 | 273 |
| 274 for (size_t i = 0; i < extension->content_scripts().size(); ++i) { | 274 for (size_t i = 0; i < extension->content_scripts().size(); ++i) { |
| 275 const UserScript& script = extension->content_scripts()[i]; | 275 const extensions::UserScript& script = extension->content_scripts()[i]; |
| 276 | 276 |
| 277 for (size_t j = 0; j < script.js_scripts().size(); j++) { | 277 for (size_t j = 0; j < script.js_scripts().size(); j++) { |
| 278 const UserScript::File& js_script = script.js_scripts()[j]; | 278 const extensions::UserScript::File& js_script = script.js_scripts()[j]; |
| 279 const FilePath& path = ExtensionResource::GetFilePath( | 279 const FilePath& path = ExtensionResource::GetFilePath( |
| 280 js_script.extension_root(), js_script.relative_path(), | 280 js_script.extension_root(), js_script.relative_path(), |
| 281 symlink_policy); | 281 symlink_policy); |
| 282 if (!IsScriptValid(path, js_script.relative_path(), | 282 if (!IsScriptValid(path, js_script.relative_path(), |
| 283 IDS_EXTENSION_LOAD_JAVASCRIPT_FAILED, error)) | 283 IDS_EXTENSION_LOAD_JAVASCRIPT_FAILED, error)) |
| 284 return false; | 284 return false; |
| 285 } | 285 } |
| 286 | 286 |
| 287 for (size_t j = 0; j < script.css_scripts().size(); j++) { | 287 for (size_t j = 0; j < script.css_scripts().size(); j++) { |
| 288 const UserScript::File& css_script = script.css_scripts()[j]; | 288 const extensions::UserScript::File& css_script = script.css_scripts()[j]; |
| 289 const FilePath& path = ExtensionResource::GetFilePath( | 289 const FilePath& path = ExtensionResource::GetFilePath( |
| 290 css_script.extension_root(), css_script.relative_path(), | 290 css_script.extension_root(), css_script.relative_path(), |
| 291 symlink_policy); | 291 symlink_policy); |
| 292 if (!IsScriptValid(path, css_script.relative_path(), | 292 if (!IsScriptValid(path, css_script.relative_path(), |
| 293 IDS_EXTENSION_LOAD_CSS_FAILED, error)) | 293 IDS_EXTENSION_LOAD_CSS_FAILED, error)) |
| 294 return false; | 294 return false; |
| 295 } | 295 } |
| 296 } | 296 } |
| 297 | 297 |
| 298 // Validate claimed plugin paths. | 298 // Validate claimed plugin paths. |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 return temp_path; | 772 return temp_path; |
| 773 | 773 |
| 774 return FilePath(); | 774 return FilePath(); |
| 775 } | 775 } |
| 776 | 776 |
| 777 void DeleteFile(const FilePath& path, bool recursive) { | 777 void DeleteFile(const FilePath& path, bool recursive) { |
| 778 file_util::Delete(path, recursive); | 778 file_util::Delete(path, recursive); |
| 779 } | 779 } |
| 780 | 780 |
| 781 } // namespace extension_file_util | 781 } // namespace extension_file_util |
| OLD | NEW |