| OLD | NEW |
| 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 #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/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 VersionInfo::~VersionInfo() { | 35 VersionInfo::~VersionInfo() { |
| 36 } | 36 } |
| 37 | 37 |
| 38 bool VersionInfo::is_valid() const { | 38 bool VersionInfo::is_valid() const { |
| 39 return version_info_.get() != NULL; | 39 return version_info_.get() != NULL; |
| 40 } | 40 } |
| 41 | 41 |
| 42 std::string VersionInfo::Name() const { | 42 std::string VersionInfo::Name() const { |
| 43 if (!is_valid()) | 43 if (!is_valid()) |
| 44 return std::string(); | 44 return std::string(); |
| 45 return UTF16ToUTF8(version_info_->product_name()); | 45 return base::UTF16ToUTF8(version_info_->product_name()); |
| 46 } | 46 } |
| 47 | 47 |
| 48 std::string VersionInfo::Version() const { | 48 std::string VersionInfo::Version() const { |
| 49 if (!is_valid()) | 49 if (!is_valid()) |
| 50 return std::string(); | 50 return std::string(); |
| 51 return UTF16ToUTF8(version_info_->product_version()); | 51 return base::UTF16ToUTF8(version_info_->product_version()); |
| 52 } | 52 } |
| 53 | 53 |
| 54 std::string VersionInfo::LastChange() const { | 54 std::string VersionInfo::LastChange() const { |
| 55 if (!is_valid()) | 55 if (!is_valid()) |
| 56 return std::string(); | 56 return std::string(); |
| 57 return UTF16ToUTF8(version_info_->last_change()); | 57 return base::UTF16ToUTF8(version_info_->last_change()); |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool VersionInfo::IsOfficialBuild() const { | 60 bool VersionInfo::IsOfficialBuild() const { |
| 61 if (!is_valid()) | 61 if (!is_valid()) |
| 62 return false; | 62 return false; |
| 63 return version_info_->is_official_build(); | 63 return version_info_->is_official_build(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 #elif defined(OS_POSIX) | 66 #elif defined(OS_POSIX) |
| 67 // We get chrome version information from chrome_version_info_posix.h, | 67 // We get chrome version information from chrome_version_info_posix.h, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 #elif defined(OS_OPENBSD) | 137 #elif defined(OS_OPENBSD) |
| 138 return "OpenBSD"; | 138 return "OpenBSD"; |
| 139 #elif defined(OS_SOLARIS) | 139 #elif defined(OS_SOLARIS) |
| 140 return "Solaris"; | 140 return "Solaris"; |
| 141 #else | 141 #else |
| 142 return "Unknown"; | 142 return "Unknown"; |
| 143 #endif | 143 #endif |
| 144 } | 144 } |
| 145 | 145 |
| 146 } // namespace chrome | 146 } // namespace chrome |
| OLD | NEW |