summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-27 20:28:42 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-27 20:28:42 +0000
commit0211f57eabdc1a3e34aee1e1629c26e93b803ded (patch)
tree3bcbab3506e5f3dbcbc99825529cc803d223b017 /chrome/browser/views
parent1f8322043d302eb0f6a050a21d2f0f9a8c1df71e (diff)
downloadchromium_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/views')
-rw-r--r--chrome/browser/views/about_chrome_view.cc17
1 files changed, 7 insertions, 10 deletions
diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc
index ff1b7d1..0863d5c 100644
--- a/chrome/browser/views/about_chrome_view.cc
+++ b/chrome/browser/views/about_chrome_view.cc
@@ -11,7 +11,6 @@
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/callback.h"
-#include "base/file_version_info.h"
#include "base/i18n/rtl.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
@@ -142,23 +141,21 @@ void AboutChromeView::Init() {
text_direction_is_rtl_ = base::i18n::IsRTL();
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- scoped_ptr<FileVersionInfo> version_info(chrome::GetChromeVersionInfo());
- if (version_info.get() == NULL) {
+ chrome::VersionInfo version_info;
+ if (!version_info.is_valid()) {
NOTREACHED() << L"Failed to initialize about window";
return;
}
- current_version_ = version_info->file_version();
+ current_version_ = ASCIIToWide(version_info.Version());
- string16 version_modifier = platform_util::GetVersionStringModifier();
- if (version_modifier.length()) {
- version_details_ += L" ";
- version_details_ += UTF16ToWide(version_modifier);
- }
+ std::string version_modifier = platform_util::GetVersionStringModifier();
+ if (!version_modifier.empty())
+ version_details_ += L" " + ASCIIToWide(version_modifier);
#if !defined(GOOGLE_CHROME_BUILD)
version_details_ += L" (";
- version_details_ += version_info->last_change();
+ version_details_ += ASCIIToWide(version_info.LastChange());
version_details_ += L")";
#endif