OLD | NEW |
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/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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 const Extension* extension, | 240 const Extension* extension, |
241 int error_message_id, | 241 int error_message_id, |
242 std::string* error) { | 242 std::string* error) { |
243 for (ExtensionIconSet::IconMap::const_iterator iter = icon_set.map().begin(); | 243 for (ExtensionIconSet::IconMap::const_iterator iter = icon_set.map().begin(); |
244 iter != icon_set.map().end(); | 244 iter != icon_set.map().end(); |
245 ++iter) { | 245 ++iter) { |
246 const base::FilePath path = | 246 const base::FilePath path = |
247 extension->GetResource(iter->second).GetFilePath(); | 247 extension->GetResource(iter->second).GetFilePath(); |
248 if (!ValidateFilePath(path)) { | 248 if (!ValidateFilePath(path)) { |
249 *error = l10n_util::GetStringFUTF8(error_message_id, | 249 *error = l10n_util::GetStringFUTF8(error_message_id, |
250 UTF8ToUTF16(iter->second)); | 250 base::UTF8ToUTF16(iter->second)); |
251 return false; | 251 return false; |
252 } | 252 } |
253 } | 253 } |
254 return true; | 254 return true; |
255 } | 255 } |
256 | 256 |
257 bool ValidateExtension(const Extension* extension, | 257 bool ValidateExtension(const Extension* extension, |
258 std::string* error, | 258 std::string* error, |
259 std::vector<extensions::InstallWarning>* warnings) { | 259 std::vector<extensions::InstallWarning>* warnings) { |
260 // Ask registered manifest handlers to validate their paths. | 260 // Ask registered manifest handlers to validate their paths. |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 return base::FilePath(); | 522 return base::FilePath(); |
523 } | 523 } |
524 return temp_path; | 524 return temp_path; |
525 } | 525 } |
526 | 526 |
527 void DeleteFile(const base::FilePath& path, bool recursive) { | 527 void DeleteFile(const base::FilePath& path, bool recursive) { |
528 base::DeleteFile(path, recursive); | 528 base::DeleteFile(path, recursive); |
529 } | 529 } |
530 | 530 |
531 } // namespace extension_file_util | 531 } // namespace extension_file_util |
OLD | NEW |