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 #include "chrome/common/chrome_version_info.h" | 5 #include "chrome/common/chrome_version_info.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/thread_restrictions.h" | 10 #include "base/thread_restrictions.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 VersionInfo::~VersionInfo() { | 25 VersionInfo::~VersionInfo() { |
26 } | 26 } |
27 | 27 |
28 bool VersionInfo::is_valid() const { | 28 bool VersionInfo::is_valid() const { |
29 return version_info_.get() != NULL; | 29 return version_info_.get() != NULL; |
30 } | 30 } |
31 | 31 |
32 std::string VersionInfo::Name() const { | 32 std::string VersionInfo::Name() const { |
33 if (!is_valid()) | 33 if (!is_valid()) |
34 return std::string(); | 34 return std::string(); |
35 return WideToASCII(version_info_->product_name()); | 35 return UTF16ToASCII(version_info_->product_name()); |
36 } | 36 } |
37 | 37 |
38 std::string VersionInfo::Version() const { | 38 std::string VersionInfo::Version() const { |
39 if (!is_valid()) | 39 if (!is_valid()) |
40 return std::string(); | 40 return std::string(); |
41 return WideToASCII(version_info_->product_version()); | 41 return UTF16ToASCII(version_info_->product_version()); |
42 } | 42 } |
43 | 43 |
44 std::string VersionInfo::LastChange() const { | 44 std::string VersionInfo::LastChange() const { |
45 if (!is_valid()) | 45 if (!is_valid()) |
46 return std::string(); | 46 return std::string(); |
47 return WideToASCII(version_info_->last_change()); | 47 return UTF16ToASCII(version_info_->last_change()); |
48 } | 48 } |
49 | 49 |
50 bool VersionInfo::IsOfficialBuild() const { | 50 bool VersionInfo::IsOfficialBuild() const { |
51 if (!is_valid()) | 51 if (!is_valid()) |
52 return false; | 52 return false; |
53 return version_info_->is_official_build(); | 53 return version_info_->is_official_build(); |
54 } | 54 } |
55 | 55 |
56 #elif defined(OS_POSIX) | 56 #elif defined(OS_POSIX) |
57 // We get chrome version information from chrome_version_info_posix.h, | 57 // We get chrome version information from chrome_version_info_posix.h, |
(...skipping 23 matching lines...) Expand all Loading... |
81 return LAST_CHANGE; | 81 return LAST_CHANGE; |
82 } | 82 } |
83 | 83 |
84 bool VersionInfo::IsOfficialBuild() const { | 84 bool VersionInfo::IsOfficialBuild() const { |
85 return OFFICIAL_BUILD; | 85 return OFFICIAL_BUILD; |
86 } | 86 } |
87 | 87 |
88 #endif | 88 #endif |
89 | 89 |
90 } // namespace chrome | 90 } // namespace chrome |
OLD | NEW |