From 01de0ce020b982f597ef6afe2b73cc2f275a7227 Mon Sep 17 00:00:00 2001 From: "mmoss@google.com" Date: Tue, 15 Dec 2009 21:40:29 +0000 Subject: Support custom Linux version strings (e.g. release channel, downstream vendor name, etc.). Also reformat the Mac/Win version strings as per comments in http://codereview.chromium.org/506007. Review URL: http://codereview.chromium.org/506016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34609 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/cocoa/about_window_controller.mm | 4 ++-- chrome/browser/gtk/about_chrome_dialog.cc | 8 ++++++-- chrome/browser/resources/about_version.html | 2 +- chrome/browser/views/about_chrome_view.cc | 9 +++++---- chrome/common/platform_util_linux.cc | 6 +----- chrome/tools/build/linux/chrome-wrapper | 4 ++++ 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/chrome/browser/cocoa/about_window_controller.mm b/chrome/browser/cocoa/about_window_controller.mm index ae71983..77c3272 100644 --- a/chrome/browser/cocoa/about_window_controller.mm +++ b/chrome/browser/cocoa/about_window_controller.mm @@ -138,8 +138,8 @@ static BOOL recentShownUserActionFailedStatus = NO; // is built on Windows too. NSString* svnRevision = [bundle objectForInfoDictionaryKey:@"SVNRevision"]; NSString* version = - [NSString stringWithFormat:@"%@%@ (%@)", - chromeVersion, versionModifier, svnRevision]; + [NSString stringWithFormat:@"%@ (%@)%@", + chromeVersion, svnRevision, versionModifier]; [version_ setStringValue:version]; diff --git a/chrome/browser/gtk/about_chrome_dialog.cc b/chrome/browser/gtk/about_chrome_dialog.cc index d840d9e..34195e8 100644 --- a/chrome/browser/gtk/about_chrome_dialog.cc +++ b/chrome/browser/gtk/about_chrome_dialog.cc @@ -17,6 +17,7 @@ #include "chrome/browser/profile.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/gtk_util.h" +#include "chrome/common/platform_util.h" #include "chrome/common/url_constants.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -105,11 +106,14 @@ void ShowAboutDialogForProfile(GtkWindow* parent, Profile* profile) { scoped_ptr version_info( FileVersionInfo::CreateFileVersionInfoForCurrentModule()); std::wstring current_version = version_info->file_version(); -#if !defined(GOOGLE_CHROME_BUILD) current_version += L" ("; current_version += version_info->last_change(); current_version += L")"; -#endif + string16 version_modifier = platform_util::GetVersionStringModifier(); + if (version_modifier.length()) { + current_version += L" "; + current_version += UTF16ToWide(version_modifier); + } // Build the dialog. GtkWidget* dialog = gtk_dialog_new_with_buttons( diff --git a/chrome/browser/resources/about_version.html b/chrome/browser/resources/about_version.html index dc87c24..cdc5235 100644 --- a/chrome/browser/resources/about_version.html +++ b/chrome/browser/resources/about_version.html @@ -74,7 +74,7 @@ about:version template page - ( ) + ( ) WebKit diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc index 0e8b79c..b73d878 100755 --- a/chrome/browser/views/about_chrome_view.cc +++ b/chrome/browser/views/about_chrome_view.cc @@ -136,15 +136,16 @@ void AboutChromeView::Init() { return; } + current_version_ = version_info->file_version(); + current_version_ += L" ("; + current_version_ += version_info->last_change(); + current_version_ += L")"; + string16 version_modifier = platform_util::GetVersionStringModifier(); if (version_modifier.length()) { current_version_ += L" "; current_version_ += UTF16ToWide(version_modifier); } - current_version_ = version_info->file_version(); - current_version_ += L" ("; - current_version_ += version_info->last_change(); - current_version_ += L")"; // Views we will add to the *parent* of this dialog, since it will display // next to the buttons which we don't draw ourselves. diff --git a/chrome/common/platform_util_linux.cc b/chrome/common/platform_util_linux.cc index 79990a5..eb991ef 100644 --- a/chrome/common/platform_util_linux.cc +++ b/chrome/common/platform_util_linux.cc @@ -90,11 +90,7 @@ void SimpleErrorBox(gfx::NativeWindow parent, /* Warning: this may be either Linux or ChromeOS */ string16 GetVersionStringModifier() { -#if defined(GOOGLE_CHROME_BUILD) - return EmptyString16(); /* TODO(jrg,mmoss) */ -#else - return EmptyString16(); -#endif + return ASCIIToUTF16(getenv("CHROME_VERSION_EXTRA")); } } // namespace platform_util diff --git a/chrome/tools/build/linux/chrome-wrapper b/chrome/tools/build/linux/chrome-wrapper index ba6c304b..12ca820 100755 --- a/chrome/tools/build/linux/chrome-wrapper +++ b/chrome/tools/build/linux/chrome-wrapper @@ -62,6 +62,10 @@ esac # Always use our ffmpeg and other shared libs. export LD_LIBRARY_PATH="$HERE:$HERE/lib:$HERE/lib.target:$LD_LIBRARY_PATH" +# Custom version string for this release. This can be used to add a downstream +# vendor string or release channel information. +export CHROME_VERSION_EXTRA="custom" + exists_desktop_file || generate_desktop_file exec "$HERE/chrome" "$@" -- cgit v1.1