| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 if (!file_util::Move(unpacked_source_dir, version_dir)) | 70 if (!file_util::Move(unpacked_source_dir, version_dir)) |
| 71 return FilePath(); | 71 return FilePath(); |
| 72 | 72 |
| 73 return version_dir; | 73 return version_dir; |
| 74 } | 74 } |
| 75 | 75 |
| 76 void UninstallExtension(const FilePath& extensions_dir, | 76 void UninstallExtension(const FilePath& extensions_dir, |
| 77 const std::string& id) { | 77 const std::string& id) { |
| 78 // We don't care about the return value. If this fails (and it can, due to | 78 // We don't care about the return value. If this fails (and it can, due to |
| 79 // plugins that aren't unloaded yet, it will get cleaned up by | 79 // plugins that aren't unloaded yet, it will get cleaned up by |
| 80 // ExtensionsService::GarbageCollectExtensions). | 80 // ExtensionService::GarbageCollectExtensions). |
| 81 file_util::Delete(extensions_dir.AppendASCII(id), true); // recursive. | 81 file_util::Delete(extensions_dir.AppendASCII(id), true); // recursive. |
| 82 } | 82 } |
| 83 | 83 |
| 84 scoped_refptr<Extension> LoadExtension(const FilePath& extension_path, | 84 scoped_refptr<Extension> LoadExtension(const FilePath& extension_path, |
| 85 Extension::Location location, | 85 Extension::Location location, |
| 86 bool require_key, | 86 bool require_key, |
| 87 std::string* error) { | 87 std::string* error) { |
| 88 FilePath manifest_path = | 88 FilePath manifest_path = |
| 89 extension_path.Append(Extension::kManifestFilename); | 89 extension_path.Append(Extension::kManifestFilename); |
| 90 if (!file_util::PathExists(manifest_path)) { | 90 if (!file_util::PathExists(manifest_path)) { |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 // It's still possible for someone to construct an annoying URL whose path | 511 // It's still possible for someone to construct an annoying URL whose path |
| 512 // would still wind up not being considered relative at this point. | 512 // would still wind up not being considered relative at this point. |
| 513 // For example: chrome-extension://id/c:////foo.html | 513 // For example: chrome-extension://id/c:////foo.html |
| 514 if (path.IsAbsolute()) | 514 if (path.IsAbsolute()) |
| 515 return FilePath(); | 515 return FilePath(); |
| 516 | 516 |
| 517 return path; | 517 return path; |
| 518 } | 518 } |
| 519 | 519 |
| 520 } // namespace extension_file_util | 520 } // namespace extension_file_util |
| OLD | NEW |