diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-14 01:46:43 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-14 01:46:43 +0000 |
commit | bcff05af3d60df10a21e07751a14b95ce9e7f3d4 (patch) | |
tree | 76d8d3ec6c6c0d9564c675d423907e29607bf253 /webkit/glue/webkit_glue.cc | |
parent | 474b2ab8c3b32c07692480aa234f3b2921fe5dd6 (diff) | |
download | chromium_src-bcff05af3d60df10a21e07751a14b95ce9e7f3d4.zip chromium_src-bcff05af3d60df10a21e07751a14b95ce9e7f3d4.tar.gz chromium_src-bcff05af3d60df10a21e07751a14b95ce9e7f3d4.tar.bz2 |
Refactor FileVersionInfo into an interface with platform implementations.
This allows us to move the chrome specific version informaton used by
Linux into src/chrome.
Add a GetChromeVersionInfo() for Linux in src/chrome/app/ and make sure to use this in src/chrome.
In src/webkit/glue, add a new glue method for getting the product version. When compiling chrome, use an implementation in src/chrome/renderer (which uses GetChromeVersionInfo()) and a stub implementation for test_shell.
Review URL: http://codereview.chromium.org/1560027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44435 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webkit_glue.cc')
-rw-r--r-- | webkit/glue/webkit_glue.cc | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc index c3426a6c..f36a0e2 100644 --- a/webkit/glue/webkit_glue.cc +++ b/webkit/glue/webkit_glue.cc @@ -11,8 +11,8 @@ #include <sys/utsname.h> #endif -#include "base/file_version_info.h" #include "base/logging.h" +#include "base/scoped_ptr.h" #include "base/singleton.h" #include "base/string_piece.h" #include "base/string_util.h" @@ -418,20 +418,8 @@ void BuildUserAgent(bool mimic_chrome1, bool mimic_windows, // Get the product name and version, and replace Safari's Version/X string // with it. This is done to expose our product name in a manner that is // maximally compatible with Safari, we hope!! - std::string product; - - if (mimic_chrome1) { - product = kChrome1ProductString; - } else { - scoped_ptr<FileVersionInfo> version_info( - FileVersionInfo::CreateFileVersionInfoForCurrentModule()); - if (version_info.get()) { - product = "Chrome/" + WideToASCII(version_info->product_version()); - } else { - DLOG(WARNING) << "Unknown product version"; - product = "Chrome/0.0.0.0"; - } - } + std::string product = mimic_chrome1 ? kChrome1ProductString + : GetProductVersion(); // Derived from Safari's UA string. StringAppendF( |