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

Side by Side Diff: chrome/installer/setup/setup_util.cc

Issue 10683005: Remove two deprecated methods from base::Version (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 8 years, 5 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file declares util functions for setup project. 5 // This file declares util functions for setup project.
6 6
7 #include "chrome/installer/setup/setup_util.h" 7 #include "chrome/installer/setup/setup_util.h"
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 } 54 }
55 55
56 Version* GetMaxVersionFromArchiveDir(const FilePath& chrome_path) { 56 Version* GetMaxVersionFromArchiveDir(const FilePath& chrome_path) {
57 VLOG(1) << "Looking for Chrome version folder under " << chrome_path.value(); 57 VLOG(1) << "Looking for Chrome version folder under " << chrome_path.value();
58 Version* version = NULL; 58 Version* version = NULL;
59 file_util::FileEnumerator version_enum(chrome_path, false, 59 file_util::FileEnumerator version_enum(chrome_path, false,
60 file_util::FileEnumerator::DIRECTORIES); 60 file_util::FileEnumerator::DIRECTORIES);
61 // TODO(tommi): The version directory really should match the version of 61 // TODO(tommi): The version directory really should match the version of
62 // setup.exe. To begin with, we should at least DCHECK that that's true. 62 // setup.exe. To begin with, we should at least DCHECK that that's true.
63 63
64 scoped_ptr<Version> max_version(Version::GetVersionFromString("0.0.0.0")); 64 scoped_ptr<Version> max_version(new Version("0.0.0.0"));
65 bool version_found = false; 65 bool version_found = false;
66 66
67 while (!version_enum.Next().empty()) { 67 while (!version_enum.Next().empty()) {
68 file_util::FileEnumerator::FindInfo find_data = {0}; 68 file_util::FileEnumerator::FindInfo find_data = {0};
69 version_enum.GetFindInfo(&find_data); 69 version_enum.GetFindInfo(&find_data);
70 VLOG(1) << "directory found: " << find_data.cFileName; 70 VLOG(1) << "directory found: " << find_data.cFileName;
71 71
72 scoped_ptr<Version> found_version( 72 scoped_ptr<Version> found_version(
73 Version::GetVersionFromString(WideToASCII(find_data.cFileName))); 73 new Version(WideToASCII(find_data.cFileName)));
74 if (found_version.get() != NULL && 74 if (found_version->IsValid() &&
75 found_version->CompareTo(*max_version.get()) > 0) { 75 found_version->CompareTo(*max_version.get()) > 0) {
76 max_version.reset(found_version.release()); 76 max_version.reset(found_version.release());
77 version_found = true; 77 version_found = true;
78 } 78 }
79 } 79 }
80 80
81 return (version_found ? max_version.release() : NULL); 81 return (version_found ? max_version.release() : NULL);
82 } 82 }
83 83
84 bool DeleteFileFromTempProcess(const FilePath& path, 84 bool DeleteFileFromTempProcess(const FilePath& path,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 ::TerminateProcess(pi.hProcess, ~0); 132 ::TerminateProcess(pi.hProcess, ~0);
133 } 133 }
134 ::CloseHandle(pi.hThread); 134 ::CloseHandle(pi.hThread);
135 ::CloseHandle(pi.hProcess); 135 ::CloseHandle(pi.hProcess);
136 } 136 }
137 137
138 return ok != FALSE; 138 return ok != FALSE;
139 } 139 }
140 140
141 } // namespace installer 141 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/setup/setup_main.cc ('k') | chrome/installer/util/google_update_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698