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

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

Issue 7618037: base: Rename FileEnumerator::FILE_TYPE to FileEnumerator::FileType. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 }; 490 };
491 static std::set<FilePath::StringType> reserved_underscore_names( 491 static std::set<FilePath::StringType> reserved_underscore_names(
492 reserved_names, reserved_names + arraysize(reserved_names)); 492 reserved_names, reserved_names + arraysize(reserved_names));
493 493
494 // Enumerate all files and directories in the extension root. 494 // Enumerate all files and directories in the extension root.
495 // There is a problem when using pattern "_*" with FileEnumerator, so we have 495 // There is a problem when using pattern "_*" with FileEnumerator, so we have
496 // to cheat with find_first_of and match all. 496 // to cheat with find_first_of and match all.
497 file_util::FileEnumerator all_files( 497 file_util::FileEnumerator all_files(
498 extension_path, 498 extension_path,
499 false, 499 false,
500 static_cast<file_util::FileEnumerator::FILE_TYPE>( 500 static_cast<file_util::FileEnumerator::FileType>(
501 file_util::FileEnumerator::DIRECTORIES | 501 file_util::FileEnumerator::DIRECTORIES |
502 file_util::FileEnumerator::FILES)); 502 file_util::FileEnumerator::FILES));
503 503
504 FilePath file; 504 FilePath file;
505 while (!(file = all_files.Next()).empty()) { 505 while (!(file = all_files.Next()).empty()) {
506 FilePath::StringType filename = file.BaseName().value(); 506 FilePath::StringType filename = file.BaseName().value();
507 // Skip all that don't start with "_". 507 // Skip all that don't start with "_".
508 if (filename.find_first_of(FILE_PATH_LITERAL("_")) != 0) continue; 508 if (filename.find_first_of(FILE_PATH_LITERAL("_")) != 0) continue;
509 if (reserved_underscore_names.find(filename) == 509 if (reserved_underscore_names.find(filename) ==
510 reserved_underscore_names.end()) { 510 reserved_underscore_names.end()) {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 return temp_path; 614 return temp_path;
615 615
616 return FilePath(); 616 return FilePath();
617 } 617 }
618 618
619 void DeleteFile(const FilePath& path, bool recursive) { 619 void DeleteFile(const FilePath& path, bool recursive) {
620 file_util::Delete(path, recursive); 620 file_util::Delete(path, recursive);
621 } 621 }
622 622
623 } // namespace extension_file_util 623 } // namespace extension_file_util
OLDNEW
« no previous file with comments | « chrome/browser/extensions/sandboxed_extension_unpacker_unittest.cc ('k') | chrome/common/zip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698