OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/startup/obsolete_system_infobar_delegate.h" | 5 #include "chrome/browser/ui/startup/obsolete_system_infobar_delegate.h" |
6 | 6 |
| 7 #include "base/cpu.h" |
7 #include "chrome/browser/infobars/infobar.h" | 8 #include "chrome/browser/infobars/infobar.h" |
8 #include "chrome/browser/infobars/infobar_service.h" | 9 #include "chrome/browser/infobars/infobar_service.h" |
9 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
10 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
11 #include "grit/chromium_strings.h" | 12 #include "grit/chromium_strings.h" |
12 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
13 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
14 | 15 |
15 #if defined(OS_MACOSX) | 16 #if defined(OS_MACOSX) |
16 #include "chrome/browser/mac/obsolete_system.h" | 17 #include "chrome/browser/mac/obsolete_system.h" |
(...skipping 16 matching lines...) Expand all Loading... |
33 // this will also deprecate other distributions (including variants of Ubuntu) | 34 // this will also deprecate other distributions (including variants of Ubuntu) |
34 // that are of a similar age. | 35 // that are of a similar age. |
35 // Version key: | 36 // Version key: |
36 // RHEL 6: GTK 2.18 | 37 // RHEL 6: GTK 2.18 |
37 // Debian 6 (Squeeze): GTK 2.20 | 38 // Debian 6 (Squeeze): GTK 2.20 |
38 // Ubuntu Lucid: GTK 2.20 | 39 // Ubuntu Lucid: GTK 2.20 |
39 // openSUSE 12.2 GTK 2.24 | 40 // openSUSE 12.2 GTK 2.24 |
40 // Ubuntu Precise: GTK 2.24 | 41 // Ubuntu Precise: GTK 2.24 |
41 if (!gtk_check_version(2, 24, 0)) | 42 if (!gtk_check_version(2, 24, 0)) |
42 return; | 43 return; |
| 44 #elif defined(OS_WIN) |
| 45 // On Windows we no longer support non-SSE2 machines since Chrome 35. |
| 46 if (base::CPU().has_sse2()) |
| 47 return; |
43 #else | 48 #else |
44 // No other platforms currently show this infobar. | 49 // No other platforms currently show this infobar. |
45 return; | 50 return; |
46 #endif | 51 #endif |
47 | 52 |
48 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( | 53 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( |
49 scoped_ptr<ConfirmInfoBarDelegate>(new ObsoleteSystemInfoBarDelegate()))); | 54 scoped_ptr<ConfirmInfoBarDelegate>(new ObsoleteSystemInfoBarDelegate()))); |
50 } | 55 } |
51 | 56 |
52 ObsoleteSystemInfoBarDelegate::ObsoleteSystemInfoBarDelegate() | 57 ObsoleteSystemInfoBarDelegate::ObsoleteSystemInfoBarDelegate() |
53 : ConfirmInfoBarDelegate() { | 58 : ConfirmInfoBarDelegate() { |
54 } | 59 } |
55 | 60 |
56 ObsoleteSystemInfoBarDelegate::~ObsoleteSystemInfoBarDelegate() { | 61 ObsoleteSystemInfoBarDelegate::~ObsoleteSystemInfoBarDelegate() { |
57 } | 62 } |
58 | 63 |
59 base::string16 ObsoleteSystemInfoBarDelegate::GetMessageText() const { | 64 base::string16 ObsoleteSystemInfoBarDelegate::GetMessageText() const { |
60 #if defined(OS_MACOSX) | 65 #if defined(OS_MACOSX) |
61 return ObsoleteSystemMac::LocalizedObsoleteSystemString(); | 66 return ObsoleteSystemMac::LocalizedObsoleteSystemString(); |
| 67 #elif defined(OS_WIN) |
| 68 return l10n_util::GetStringUTF16(IDS_WIN_SSE_OBSOLETE_NOW); |
62 #else | 69 #else |
63 return l10n_util::GetStringUTF16(IDS_SYSTEM_OBSOLETE_MESSAGE); | 70 return l10n_util::GetStringUTF16(IDS_SYSTEM_OBSOLETE_MESSAGE); |
64 #endif | 71 #endif |
65 } | 72 } |
66 | 73 |
67 int ObsoleteSystemInfoBarDelegate::GetButtons() const { | 74 int ObsoleteSystemInfoBarDelegate::GetButtons() const { |
68 return BUTTON_NONE; | 75 return BUTTON_NONE; |
69 } | 76 } |
70 | 77 |
71 base::string16 ObsoleteSystemInfoBarDelegate::GetLinkText() const { | 78 base::string16 ObsoleteSystemInfoBarDelegate::GetLinkText() const { |
72 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); | 79 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
73 } | 80 } |
74 | 81 |
75 bool ObsoleteSystemInfoBarDelegate::LinkClicked( | 82 bool ObsoleteSystemInfoBarDelegate::LinkClicked( |
76 WindowOpenDisposition disposition) { | 83 WindowOpenDisposition disposition) { |
77 web_contents()->OpenURL(content::OpenURLParams( | 84 web_contents()->OpenURL(content::OpenURLParams( |
78 #if defined(OS_MACOSX) | 85 #if defined(OS_MACOSX) |
79 GURL(chrome::kMac32BitDeprecationURL), | 86 GURL(chrome::kMac32BitDeprecationURL), |
80 #else | 87 #else |
81 GURL("http://www.google.com/support/chrome/bin/answer.py?answer=95411"), | 88 GURL("http://www.google.com/support/chrome/bin/answer.py?answer=95411"), |
82 #endif | 89 #endif |
83 content::Referrer(), | 90 content::Referrer(), |
84 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 91 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
85 content::PAGE_TRANSITION_LINK, false)); | 92 content::PAGE_TRANSITION_LINK, false)); |
86 return false; | 93 return false; |
87 } | 94 } |
OLD | NEW |