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

Unified Diff: chrome/installer/setup/setup_util.cc

Issue 16392011: Move FileEnumerator to its own file, do some refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix incorrect includes Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/unpacker.cc ('k') | chrome/installer/setup/uninstall.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/setup_util.cc
diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc
index 55a4a8b1bdf8353e614e181b7603d2dc03a8af74..768755a7f2cb98d1270d7a2225ab781d293eefec 100644
--- a/chrome/installer/setup/setup_util.cc
+++ b/chrome/installer/setup/setup_util.cc
@@ -10,6 +10,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
+#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/process_util.h"
@@ -125,8 +126,8 @@ int ApplyDiffPatch(const base::FilePath& src,
Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path) {
VLOG(1) << "Looking for Chrome version folder under " << chrome_path.value();
Version* version = NULL;
- file_util::FileEnumerator version_enum(chrome_path, false,
- file_util::FileEnumerator::DIRECTORIES);
+ base::FileEnumerator version_enum(chrome_path, false,
+ base::FileEnumerator::DIRECTORIES);
// TODO(tommi): The version directory really should match the version of
// setup.exe. To begin with, we should at least DCHECK that that's true.
@@ -134,12 +135,11 @@ Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path) {
bool version_found = false;
while (!version_enum.Next().empty()) {
- file_util::FileEnumerator::FindInfo find_data = {0};
- version_enum.GetFindInfo(&find_data);
- VLOG(1) << "directory found: " << find_data.cFileName;
+ base::FileEnumerator::FileInfo find_data = version_enum.GetInfo();
+ VLOG(1) << "directory found: " << find_data.GetName().value();
scoped_ptr<Version> found_version(
- new Version(WideToASCII(find_data.cFileName)));
+ new Version(WideToASCII(find_data.GetName().value())));
if (found_version->IsValid() &&
found_version->CompareTo(*max_version.get()) > 0) {
max_version.reset(found_version.release());
« no previous file with comments | « chrome/common/extensions/unpacker.cc ('k') | chrome/installer/setup/uninstall.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698