OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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" |
| 11 #include "base/string_util.h" |
11 #include "chrome/installer/util/master_preferences.h" | 12 #include "chrome/installer/util/master_preferences.h" |
12 #include "chrome/installer/util/util_constants.h" | 13 #include "chrome/installer/util/util_constants.h" |
13 #include "courgette/courgette.h" | 14 #include "courgette/courgette.h" |
14 #include "third_party/bspatch/mbspatch.h" | 15 #include "third_party/bspatch/mbspatch.h" |
15 | 16 |
16 int installer::ApplyDiffPatch(const FilePath& src, | 17 int installer::ApplyDiffPatch(const FilePath& src, |
17 const FilePath& patch, | 18 const FilePath& patch, |
18 const FilePath& dest) { | 19 const FilePath& dest) { |
19 VLOG(1) << "Applying patch " << patch.value() << " to file " << src.value() | 20 VLOG(1) << "Applying patch " << patch.value() << " to file " << src.value() |
20 << " and generating file " << dest.value(); | 21 << " and generating file " << dest.value(); |
(...skipping 17 matching lines...) Expand all Loading... |
38 Version* version = NULL; | 39 Version* version = NULL; |
39 file_util::FileEnumerator version_enum(chrome_path, false, | 40 file_util::FileEnumerator version_enum(chrome_path, false, |
40 file_util::FileEnumerator::DIRECTORIES); | 41 file_util::FileEnumerator::DIRECTORIES); |
41 // TODO(tommi): The version directory really should match the version of | 42 // TODO(tommi): The version directory really should match the version of |
42 // setup.exe. To begin with, we should at least DCHECK that that's true. | 43 // setup.exe. To begin with, we should at least DCHECK that that's true. |
43 | 44 |
44 while (!version_enum.Next().empty()) { | 45 while (!version_enum.Next().empty()) { |
45 file_util::FileEnumerator::FindInfo find_data = {0}; | 46 file_util::FileEnumerator::FindInfo find_data = {0}; |
46 version_enum.GetFindInfo(&find_data); | 47 version_enum.GetFindInfo(&find_data); |
47 VLOG(1) << "directory found: " << find_data.cFileName; | 48 VLOG(1) << "directory found: " << find_data.cFileName; |
48 version = Version::GetVersionFromString(find_data.cFileName); | 49 version = Version::GetVersionFromString(WideToASCII(find_data.cFileName)); |
49 if (version) | 50 if (version) |
50 break; | 51 break; |
51 } | 52 } |
52 | 53 |
53 return version; | 54 return version; |
54 } | 55 } |
OLD | NEW |