OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser/extensions/extension_file_util.h" | 5 #include "chrome/browser/extensions/extension_file_util.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 app_locale, | 377 app_locale, |
378 locales, | 378 locales, |
379 error); | 379 error); |
380 return message_bundle; | 380 return message_bundle; |
381 } | 381 } |
382 | 382 |
383 bool CheckForIllegalFilenames(const FilePath& extension_path, | 383 bool CheckForIllegalFilenames(const FilePath& extension_path, |
384 std::string* error) { | 384 std::string* error) { |
385 // Reserved underscore names. | 385 // Reserved underscore names. |
386 static const char* reserved_names[] = { | 386 static const char* reserved_names[] = { |
387 Extension::kLocaleFolder | 387 Extension::kLocaleFolder, |
| 388 "__MACOSX" |
388 }; | 389 }; |
389 static std::set<std::string> reserved_underscore_names( | 390 static std::set<std::string> reserved_underscore_names( |
390 reserved_names, reserved_names + arraysize(reserved_names)); | 391 reserved_names, reserved_names + arraysize(reserved_names)); |
391 | 392 |
392 // Enumerate all files and directories in the extension root. | 393 // Enumerate all files and directories in the extension root. |
393 // There is a problem when using pattern "_*" with FileEnumerator, so we have | 394 // There is a problem when using pattern "_*" with FileEnumerator, so we have |
394 // to cheat with find_first_of and match all. | 395 // to cheat with find_first_of and match all. |
395 file_util::FileEnumerator all_files( | 396 file_util::FileEnumerator all_files( |
396 extension_path, | 397 extension_path, |
397 false, | 398 false, |
(...skipping 14 matching lines...) Expand all Loading... |
412 "Filenames starting with \"_\" are reserved for use by the system.", | 413 "Filenames starting with \"_\" are reserved for use by the system.", |
413 filename.c_str()); | 414 filename.c_str()); |
414 return false; | 415 return false; |
415 } | 416 } |
416 } | 417 } |
417 | 418 |
418 return true; | 419 return true; |
419 } | 420 } |
420 | 421 |
421 } // namespace extension_file_util | 422 } // namespace extension_file_util |
OLD | NEW |