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 "base/version.h" | 5 #include "base/version.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "base/string_split.h" |
9 #include "base/string_util.h" | 10 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
11 | 12 |
12 // static | 13 // static |
13 Version* Version::GetVersionFromString(const std::wstring& version_str) { | 14 Version* Version::GetVersionFromString(const std::wstring& version_str) { |
14 if (!IsStringASCII(version_str)) | 15 if (!IsStringASCII(version_str)) |
15 return NULL; | 16 return NULL; |
16 return GetVersionFromString(WideToUTF8(version_str)); | 17 return GetVersionFromString(WideToUTF8(version_str)); |
17 } | 18 } |
18 | 19 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 return false; | 88 return false; |
88 // This throws out things like +3, or 032. | 89 // This throws out things like +3, or 032. |
89 if (base::IntToString(num) != *i) | 90 if (base::IntToString(num) != *i) |
90 return false; | 91 return false; |
91 uint16 component = static_cast<uint16>(num); | 92 uint16 component = static_cast<uint16>(num); |
92 components_.push_back(component); | 93 components_.push_back(component); |
93 } | 94 } |
94 is_valid_ = true; | 95 is_valid_ = true; |
95 return true; | 96 return true; |
96 } | 97 } |
OLD | NEW |