From 0d920aacaa1c7439ad940b282ea84dd3c3dacfd4 Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Thu, 19 May 2011 21:43:28 +0000 Subject: linux: infobar for obsolete OS We will stop providing Chrome releases for Ubuntu Hardy-era distros. We should at least inform those users about this. (Retry of r85956, with views fix.) BUG=79401 TEST=tried manually changing code to require a newer GTK, saw infobar Review URL: http://codereview.chromium.org/7012024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85977 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/ui/browser_init.cc | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'chrome/browser/ui/browser_init.cc') diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc index a3b3c40..132f023 100644 --- a/chrome/browser/ui/browser_init.cc +++ b/chrome/browser/ui/browser_init.cc @@ -78,7 +78,7 @@ #include "chrome/browser/ui/cocoa/keystone_infobar.h" #endif -#if defined(TOOLKIT_GTK) +#if defined(TOOLKIT_USES_GTK) #include "chrome/browser/ui/gtk/gtk_util.h" #endif @@ -1027,6 +1027,7 @@ void BrowserInit::LaunchWithProfile::AddInfoBarsIfNecessary(Browser* browser) { AddCrashedInfoBarIfNecessary(tab_contents); AddBadFlagsInfoBarIfNecessary(tab_contents); AddDNSCertProvenanceCheckingWarningInfoBarIfNecessary(tab_contents); + AddObsoleteSystemInfoBarIfNecessary(tab_contents); } void BrowserInit::LaunchWithProfile::AddCrashedInfoBarIfNecessary( @@ -1139,6 +1140,31 @@ void BrowserInit::LaunchWithProfile:: GURL(kLearnMoreURL))); } +void BrowserInit::LaunchWithProfile::AddObsoleteSystemInfoBarIfNecessary( + TabContentsWrapper* tab) { +#if defined(TOOLKIT_USES_GTK) + // We've deprecated support for Ubuntu Hardy. Rather than attempting to + // determine whether you're using that, we instead key off the GTK version; + // this will also deprecate other distributions (including variants of Ubuntu) + // that are of a similar age. + // Version key: + // Ubuntu Hardy: GTK 2.12 + // RHEL 6: GTK 2.18 + // Ubuntu Lucid: GTK 2.20 + if (gtk_check_version(2, 18, 0)) { + string16 message = + l10n_util::GetStringFUTF16(IDS_SYSTEM_OBSOLETE_MESSAGE, + l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); + // Link to an article in the help center on minimum system requirements. + const char* kLearnMoreURL = + "http://www.google.com/support/chrome/bin/answer.py?answer=95411"; + tab->AddInfoBar(new LearnMoreInfoBar(tab->tab_contents(), + message, + GURL(kLearnMoreURL))); + } +#endif +} + void BrowserInit::LaunchWithProfile::AddStartupURLs( std::vector* startup_urls) const { // If we have urls specified beforehand (i.e. from command line) use them -- cgit v1.1