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

Side by Side Diff: chrome/browser/extensions/extension_file_util.cc

Issue 340018: Filter out hidden files, both when loading extensions and when (Closed)
Patch Set: Created 11 years, 1 month 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
« no previous file with comments | « chrome/browser/extensions/extension_creator.cc ('k') | chrome/common/zip.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_creator.cc ('k') | chrome/common/zip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698