Index: chrome/browser/ui/startup/obsolete_system_infobar_delegate.cc |
diff --git a/chrome/browser/ui/startup/obsolete_os_infobar_delegate.cc b/chrome/browser/ui/startup/obsolete_system_infobar_delegate.cc |
similarity index 60% |
rename from chrome/browser/ui/startup/obsolete_os_infobar_delegate.cc |
rename to chrome/browser/ui/startup/obsolete_system_infobar_delegate.cc |
index 5522cbf7c28d79a67811552a42afa740af82ff5b..00061b401c4217ae3596ca195d00f8e7b76fa807 100644 |
--- a/chrome/browser/ui/startup/obsolete_os_infobar_delegate.cc |
+++ b/chrome/browser/ui/startup/obsolete_system_infobar_delegate.cc |
@@ -2,23 +2,31 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/browser/ui/startup/obsolete_os_infobar_delegate.h" |
+#include "chrome/browser/ui/startup/obsolete_system_infobar_delegate.h" |
#include "chrome/browser/infobars/infobar.h" |
#include "chrome/browser/infobars/infobar_service.h" |
+#include "chrome/common/url_constants.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(OS_MACOSX) |
+#include "chrome/browser/mac/system_bitness.h" |
+#endif |
+ |
#if defined(TOOLKIT_GTK) |
#include <gtk/gtk.h> |
#endif |
- |
// static |
-void ObsoleteOSInfoBarDelegate::Create(InfoBarService* infobar_service) { |
-#if defined(TOOLKIT_GTK) |
+void ObsoleteSystemInfoBarDelegate::Create(InfoBarService* infobar_service) { |
+#if defined(OS_MACOSX) |
+ if (!chrome::Is32BitObsoleteNowOrSoon() || !chrome::Has32BitOnlyCPU()) { |
+ return; |
+ } |
+#elif defined(TOOLKIT_GTK) |
// We've deprecated support for Ubuntu Lucid. 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) |
@@ -37,31 +45,40 @@ void ObsoleteOSInfoBarDelegate::Create(InfoBarService* infobar_service) { |
#endif |
infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( |
- scoped_ptr<ConfirmInfoBarDelegate>(new ObsoleteOSInfoBarDelegate()))); |
+ scoped_ptr<ConfirmInfoBarDelegate>(new ObsoleteSystemInfoBarDelegate()))); |
} |
-ObsoleteOSInfoBarDelegate::ObsoleteOSInfoBarDelegate() |
+ObsoleteSystemInfoBarDelegate::ObsoleteSystemInfoBarDelegate() |
: ConfirmInfoBarDelegate() { |
} |
-ObsoleteOSInfoBarDelegate::~ObsoleteOSInfoBarDelegate() { |
+ObsoleteSystemInfoBarDelegate::~ObsoleteSystemInfoBarDelegate() { |
} |
-base::string16 ObsoleteOSInfoBarDelegate::GetMessageText() const { |
+base::string16 ObsoleteSystemInfoBarDelegate::GetMessageText() const { |
+#if defined(OS_MACOSX) |
+ return chrome::LocalizedObsoleteSystemString(); |
+#else |
return l10n_util::GetStringUTF16(IDS_SYSTEM_OBSOLETE_MESSAGE); |
+#endif |
} |
-int ObsoleteOSInfoBarDelegate::GetButtons() const { |
+int ObsoleteSystemInfoBarDelegate::GetButtons() const { |
return BUTTON_NONE; |
} |
-base::string16 ObsoleteOSInfoBarDelegate::GetLinkText() const { |
+base::string16 ObsoleteSystemInfoBarDelegate::GetLinkText() const { |
return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
} |
-bool ObsoleteOSInfoBarDelegate::LinkClicked(WindowOpenDisposition disposition) { |
+bool ObsoleteSystemInfoBarDelegate::LinkClicked( |
+ WindowOpenDisposition disposition) { |
web_contents()->OpenURL(content::OpenURLParams( |
+#if defined(OS_MACOSX) |
+ GURL(chrome::kMac32BitDeprecationURL), |
+#else |
GURL("http://www.google.com/support/chrome/bin/answer.py?answer=95411"), |
+#endif |
content::Referrer(), |
(disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
content::PAGE_TRANSITION_LINK, false)); |