Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / ui / startup / obsolete_system_infobar_delegate.cc
blob233451f423bd548dc72cc7a180803c609f70bfa6
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/startup/obsolete_system_infobar_delegate.h"
7 #include "chrome/browser/infobars/infobar_service.h"
8 #include "chrome/common/url_constants.h"
9 #include "chrome/grit/chromium_strings.h"
10 #include "components/infobars/core/infobar.h"
11 #include "content/public/browser/web_contents.h"
12 #include "grit/components_strings.h"
13 #include "ui/base/l10n/l10n_util.h"
15 #if defined(OS_MACOSX)
16 #include "chrome/browser/mac/obsolete_system.h"
17 #endif
19 // static
20 void ObsoleteSystemInfoBarDelegate::Create(InfoBarService* infobar_service) {
21 #if defined(OS_MACOSX)
22 if (!ObsoleteSystemMac::Is32BitObsoleteNowOrSoon() ||
23 !ObsoleteSystemMac::Has32BitOnlyCPU()) {
24 return;
26 infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
27 scoped_ptr<ConfirmInfoBarDelegate>(new ObsoleteSystemInfoBarDelegate())));
28 #else
29 // No other platforms currently show this infobar.
30 return;
31 #endif
34 ObsoleteSystemInfoBarDelegate::ObsoleteSystemInfoBarDelegate()
35 : ConfirmInfoBarDelegate() {
38 ObsoleteSystemInfoBarDelegate::~ObsoleteSystemInfoBarDelegate() {
41 base::string16 ObsoleteSystemInfoBarDelegate::GetMessageText() const {
42 #if defined(OS_MACOSX)
43 return ObsoleteSystemMac::LocalizedObsoleteSystemString();
44 #else
45 return l10n_util::GetStringUTF16(IDS_SYSTEM_OBSOLETE_MESSAGE);
46 #endif
49 int ObsoleteSystemInfoBarDelegate::GetButtons() const {
50 return BUTTON_NONE;
53 base::string16 ObsoleteSystemInfoBarDelegate::GetLinkText() const {
54 return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
57 bool ObsoleteSystemInfoBarDelegate::LinkClicked(
58 WindowOpenDisposition disposition) {
59 InfoBarService::WebContentsFromInfoBar(infobar())->OpenURL(
60 content::OpenURLParams(
61 #if defined(OS_MACOSX)
62 GURL(chrome::kMac32BitDeprecationURL),
63 #else
64 GURL("https://support.google.com/chrome/answer/95411"),
65 #endif
66 content::Referrer(),
67 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
68 ui::PAGE_TRANSITION_LINK, false));
69 return false;