Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: chrome/browser/ui/startup/obsolete_os_info_bar.cc

Issue 11644059: Change infobar creation to use a public static Create() method on the infobar delegate classes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/startup/obsolete_os_info_bar.h ('k') | chrome/browser/ui/startup/obsolete_os_prompt.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/startup/obsolete_os_info_bar.cc
===================================================================
--- chrome/browser/ui/startup/obsolete_os_info_bar.cc (revision 175396)
+++ chrome/browser/ui/startup/obsolete_os_info_bar.cc (working copy)
@@ -6,23 +6,43 @@
#include "chrome/browser/api/infobars/infobar_service.h"
#include "content/public/browser/web_contents.h"
+#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
+#if defined(TOOLKIT_GTK)
+#include <gtk/gtk.h>
+#endif
+
using content::OpenURLParams;
using content::Referrer;
namespace chrome {
-ObsoleteOSInfoBar::ObsoleteOSInfoBar(InfoBarService* infobar_service,
- const string16& message,
- const GURL& url)
- : ConfirmInfoBarDelegate(infobar_service),
- message_(message),
- learn_more_url_(url) {
-}
+// static
+void ObsoleteOSInfoBar::Create(InfoBarService* infobar_service) {
+#if defined(TOOLKIT_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))
+ return;
+#else
+ // No other platforms currently show this infobar.
+ return;
+#endif
-ObsoleteOSInfoBar::~ObsoleteOSInfoBar() {
+ string16 message = l10n_util::GetStringUTF16(IDS_SYSTEM_OBSOLETE_MESSAGE);
+ // 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";
+ infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>(
+ new ObsoleteOSInfoBar(infobar_service, message, GURL(kLearnMoreURL))));
}
string16 ObsoleteOSInfoBar::GetMessageText() const {
@@ -45,4 +65,15 @@
return false;
}
+ObsoleteOSInfoBar::ObsoleteOSInfoBar(InfoBarService* infobar_service,
+ const string16& message,
+ const GURL& url)
+ : ConfirmInfoBarDelegate(infobar_service),
+ message_(message),
+ learn_more_url_(url) {
+}
+
+ObsoleteOSInfoBar::~ObsoleteOSInfoBar() {
+}
+
} // namespace chrome
« no previous file with comments | « chrome/browser/ui/startup/obsolete_os_info_bar.h ('k') | chrome/browser/ui/startup/obsolete_os_prompt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698