diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-27 20:28:42 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-27 20:28:42 +0000 |
commit | 0211f57eabdc1a3e34aee1e1629c26e93b803ded (patch) | |
tree | 3bcbab3506e5f3dbcbc99825529cc803d223b017 /chrome/browser/upgrade_detector.cc | |
parent | 1f8322043d302eb0f6a050a21d2f0f9a8c1df71e (diff) | |
download | chromium_src-0211f57eabdc1a3e34aee1e1629c26e93b803ded.zip chromium_src-0211f57eabdc1a3e34aee1e1629c26e93b803ded.tar.gz chromium_src-0211f57eabdc1a3e34aee1e1629c26e93b803ded.tar.bz2 |
Refactor version-getting info into a chrome::VersionInfo object.
I was trying to replace wstring usage in base::FileVersionInfo, but
that class is rather Windows-specific with strange fields like
"private_build()" where the value and encoding aren't clear. 95%
of the users of FileVersionInfo actually just care about the current
Chrome version, so we can provide a much simpler interface for them.
We still use FileVersionInfo for retrieving information from e.g.
plugin DLLs, but in those cases the usage is clearer.
Review URL: http://codereview.chromium.org/3135028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57725 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/upgrade_detector.cc')
-rw-r--r-- | chrome/browser/upgrade_detector.cc | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/chrome/browser/upgrade_detector.cc b/chrome/browser/upgrade_detector.cc index 38e5a49..ae21a23 100644 --- a/chrome/browser/upgrade_detector.cc +++ b/chrome/browser/upgrade_detector.cc @@ -7,7 +7,6 @@ #include <string> #include "base/command_line.h" -#include "base/file_version_info.h" #include "base/scoped_ptr.h" #include "base/time.h" #include "base/task.h" @@ -102,14 +101,13 @@ class DetectUpgradeTask : public Task { #endif // Get the version of the currently *running* instance of Chrome. - scoped_ptr<FileVersionInfo> version(chrome::GetChromeVersionInfo()); - if (version.get() == NULL) { + chrome::VersionInfo version_info; + if (!version_info.is_valid()) { NOTREACHED() << "Failed to get current file version"; return; } - scoped_ptr<Version> running_version( - Version::GetVersionFromString(WideToUTF16(version->file_version()))); + Version::GetVersionFromString(ASCIIToUTF16(version_info.Version()))); if (running_version.get() == NULL) { NOTREACHED() << "Failed to parse version info"; return; |