OLD | NEW |
1 // Copyright (c) 2009 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 #include <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" |
9 #include "chrome/installer/util/version.h" | 10 #include "chrome/installer/util/version.h" |
10 | 11 |
11 installer::Version::Version(int64 major, int64 minor, int64 build, | 12 installer::Version::Version(int64 major, int64 minor, int64 build, |
12 int64 patch) | 13 int64 patch) |
13 : major_(major), | 14 : major_(major), |
14 minor_(minor), | 15 minor_(minor), |
15 build_(build), | 16 build_(build), |
16 patch_(patch) { | 17 patch_(patch) { |
17 version_str_ = ASCIIToUTF16( | 18 version_str_ = ASCIIToUTF16( |
18 StringPrintf("%" PRId64 ".%" PRId64 ".%" PRId64 ".%" PRId64, | 19 StringPrintf("%" PRId64 ".%" PRId64 ".%" PRId64 ".%" PRId64, |
(...skipping 19 matching lines...) Expand all Loading... |
38 SplitString(version_str, '.', &numbers); | 39 SplitString(version_str, '.', &numbers); |
39 | 40 |
40 if (numbers.size() != 4) { | 41 if (numbers.size() != 4) { |
41 LOG(ERROR) << "Invalid version string: " << version_str; | 42 LOG(ERROR) << "Invalid version string: " << version_str; |
42 return NULL; | 43 return NULL; |
43 } | 44 } |
44 | 45 |
45 return new Version(StringToInt64(numbers[0]), StringToInt64(numbers[1]), | 46 return new Version(StringToInt64(numbers[0]), StringToInt64(numbers[1]), |
46 StringToInt64(numbers[2]), StringToInt64(numbers[3])); | 47 StringToInt64(numbers[2]), StringToInt64(numbers[3])); |
47 } | 48 } |
OLD | NEW |