Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: chrome/common/chrome_version_info.cc

Issue 5815001: Fixed file_version_info so that it finds Mac values correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added a file Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/chrome_version_info.cc
diff --git a/chrome/common/chrome_version_info.cc b/chrome/common/chrome_version_info.cc
index 5157c4a4e3a81c6790b4974e33977a4393f9cacf..16999f115c543fc27d708f6d965e20243182c526 100644
--- a/chrome/common/chrome_version_info.cc
+++ b/chrome/common/chrome_version_info.cc
@@ -9,12 +9,13 @@
#include "base/string_util.h"
#include "base/thread_restrictions.h"
#include "build/build_config.h"
+#include "chrome/common/chrome_constants.h"
namespace chrome {
#if defined(OS_WIN) || defined(OS_MACOSX)
-// On Windows and Mac, we get the Chrome version info by querying
-// FileVersionInfo for the current module.
+// On Windows and Mac we get the Chrome version info by querying FileVersionInfo
+// for the current module.
VersionInfo::VersionInfo() {
// The current module is already loaded in memory, so this will be cheap.
@@ -25,31 +26,20 @@ VersionInfo::VersionInfo() {
VersionInfo::~VersionInfo() {
}
-bool VersionInfo::is_valid() const {
- return version_info_.get() != NULL;
-}
-
std::string VersionInfo::Name() const {
- if (!is_valid())
- return std::string();
- return WideToASCII(version_info_->product_name());
+ std::wstring name = version_info_->product_name();
+ return WideToASCII(name);
}
std::string VersionInfo::Version() const {
- if (!is_valid())
- return std::string();
return WideToASCII(version_info_->product_version());
}
std::string VersionInfo::LastChange() const {
- if (!is_valid())
- return std::string();
return WideToASCII(version_info_->last_change());
}
bool VersionInfo::IsOfficialBuild() const {
- if (!is_valid())
- return false;
return version_info_->is_official_build();
}
@@ -65,10 +55,6 @@ VersionInfo::VersionInfo() {
VersionInfo::~VersionInfo() {
}
-bool VersionInfo::is_valid() const {
- return true;
-}
-
std::string VersionInfo::Name() const {
return PRODUCT_NAME;
}

Powered by Google App Engine
This is Rietveld 408576698