| 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 59%
|
| rename from chrome/browser/ui/startup/obsolete_os_infobar_delegate.cc
|
| rename to chrome/browser/ui/startup/obsolete_system_infobar_delegate.cc
|
| index 5522cbf7c28d79a67811552a42afa740af82ff5b..fb4a4be8bc211f872c8f08e058a40b1f68dc9025 100644
|
| --- a/chrome/browser/ui/startup/obsolete_os_infobar_delegate.cc
|
| +++ b/chrome/browser/ui/startup/obsolete_system_infobar_delegate.cc
|
| @@ -2,23 +2,32 @@
|
| // 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/obsolete_system.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 (!ObsoleteSystemMac::Is32BitObsoleteNowOrSoon() ||
|
| + !ObsoleteSystemMac::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 +46,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 ObsoleteSystemMac::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));
|
|
|