summaryrefslogtreecommitdiffstats
path: root/chrome/common/chrome_version_info.cc
diff options
context:
space:
mode:
authordmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-18 00:31:30 +0000
committerdmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-18 00:31:30 +0000
commitd9cb161850584e5d277b141aadb68abec0af28bb (patch)
tree52cdb82bc14b488f7c93edcaa018550fcd8c9cc3 /chrome/common/chrome_version_info.cc
parent92f132ae9e06a0f55d65b44a324ac74b53a2945d (diff)
downloadchromium_src-d9cb161850584e5d277b141aadb68abec0af28bb.zip
chromium_src-d9cb161850584e5d277b141aadb68abec0af28bb.tar.gz
chromium_src-d9cb161850584e5d277b141aadb68abec0af28bb.tar.bz2
file_version_info was not finding Mac values correctly.
Changed file_version_info to find Mac values, and changed version_info to fail if values can't be found. BUG=NONE TEST=BUILD Review URL: http://codereview.chromium.org/5815001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69592 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/chrome_version_info.cc')
-rw-r--r--chrome/common/chrome_version_info.cc25
1 files changed, 6 insertions, 19 deletions
diff --git a/chrome/common/chrome_version_info.cc b/chrome/common/chrome_version_info.cc
index 5157c4a..70e8cb24 100644
--- a/chrome/common/chrome_version_info.cc
+++ b/chrome/common/chrome_version_info.cc
@@ -9,47 +9,38 @@
#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.
base::ThreadRestrictions::ScopedAllowIO allow_io;
version_info_.reset(FileVersionInfo::CreateFileVersionInfoForCurrentModule());
+ DCHECK(version_info_.get());
}
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 +56,6 @@ VersionInfo::VersionInfo() {
VersionInfo::~VersionInfo() {
}
-bool VersionInfo::is_valid() const {
- return true;
-}
-
std::string VersionInfo::Name() const {
return PRODUCT_NAME;
}