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/gtk | |
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/gtk')
-rw-r--r-- | chrome/browser/gtk/about_chrome_dialog.cc | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/chrome/browser/gtk/about_chrome_dialog.cc b/chrome/browser/gtk/about_chrome_dialog.cc index edfb269..29f9159 100644 --- a/chrome/browser/gtk/about_chrome_dialog.cc +++ b/chrome/browser/gtk/about_chrome_dialog.cc @@ -11,7 +11,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "base/file_version_info.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/gtk/cairo_cached_surface.h" @@ -108,18 +107,16 @@ gboolean OnEventBoxExpose(GtkWidget* event_box, void ShowAboutDialogForProfile(GtkWindow* parent, Profile* profile) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); static GdkPixbuf* background = rb.GetPixbufNamed(IDR_ABOUT_BACKGROUND); - scoped_ptr<FileVersionInfo> version_info(chrome::GetChromeVersionInfo()); - std::wstring current_version = version_info->file_version(); + chrome::VersionInfo version_info; + std::string current_version = version_info.Version(); #if !defined(GOOGLE_CHROME_BUILD) - current_version += L" ("; - current_version += version_info->last_change(); - current_version += L")"; + current_version += " ("; + current_version += version_info.LastChange(); + current_version += ")"; #endif - string16 version_modifier = platform_util::GetVersionStringModifier(); - if (version_modifier.length()) { - current_version += L" "; - current_version += UTF16ToWide(version_modifier); - } + std::string channel = platform_util::GetVersionStringModifier(); + if (!channel.empty()) + current_version += " " + channel; // Build the dialog. GtkWidget* dialog = gtk_dialog_new_with_buttons( @@ -159,7 +156,7 @@ void ShowAboutDialogForProfile(GtkWindow* parent, Profile* profile) { gtk_widget_modify_fg(product_label, GTK_STATE_NORMAL, &black); gtk_box_pack_start(GTK_BOX(text_vbox), product_label, FALSE, FALSE, 0); - GtkWidget* version_label = gtk_label_new(WideToUTF8(current_version).c_str()); + GtkWidget* version_label = gtk_label_new(current_version.c_str()); gtk_misc_set_alignment(GTK_MISC(version_label), 0.0, 0.5); gtk_label_set_selectable(GTK_LABEL(version_label), TRUE); gtk_widget_modify_fg(version_label, GTK_STATE_NORMAL, &black); |