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 "base/cpu.h" |
8 #include "chrome/browser/infobars/infobar.h" | 8 #include "chrome/browser/infobars/infobar.h" |
| 9 #include "chrome/browser/infobars/infobar_manager.h" |
9 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
10 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
11 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
12 #include "grit/chromium_strings.h" | 13 #include "grit/chromium_strings.h" |
13 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
14 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
15 | 16 |
16 #if defined(OS_MACOSX) | 17 #if defined(OS_MACOSX) |
17 #include "chrome/browser/mac/obsolete_system.h" | 18 #include "chrome/browser/mac/obsolete_system.h" |
18 #endif | 19 #endif |
(...skipping 24 matching lines...) Expand all Loading... |
43 return; | 44 return; |
44 #elif defined(OS_WIN) | 45 #elif defined(OS_WIN) |
45 // On Windows we no longer support non-SSE2 machines since Chrome 35. | 46 // On Windows we no longer support non-SSE2 machines since Chrome 35. |
46 if (base::CPU().has_sse2()) | 47 if (base::CPU().has_sse2()) |
47 return; | 48 return; |
48 #else | 49 #else |
49 // No other platforms currently show this infobar. | 50 // No other platforms currently show this infobar. |
50 return; | 51 return; |
51 #endif | 52 #endif |
52 | 53 |
53 infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( | 54 infobar_service->AddInfoBar( |
54 scoped_ptr<ConfirmInfoBarDelegate>(new ObsoleteSystemInfoBarDelegate()))); | 55 ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>( |
| 56 new ObsoleteSystemInfoBarDelegate(infobar_service->web_contents())))); |
55 } | 57 } |
56 | 58 |
57 ObsoleteSystemInfoBarDelegate::ObsoleteSystemInfoBarDelegate() | 59 ObsoleteSystemInfoBarDelegate::ObsoleteSystemInfoBarDelegate( |
58 : ConfirmInfoBarDelegate() { | 60 content::WebContents* web_contents) |
59 } | 61 : ContentConfirmInfoBarDelegate(web_contents) {} |
60 | 62 |
61 ObsoleteSystemInfoBarDelegate::~ObsoleteSystemInfoBarDelegate() { | 63 ObsoleteSystemInfoBarDelegate::~ObsoleteSystemInfoBarDelegate() { |
62 } | 64 } |
63 | 65 |
64 base::string16 ObsoleteSystemInfoBarDelegate::GetMessageText() const { | 66 base::string16 ObsoleteSystemInfoBarDelegate::GetMessageText() const { |
65 #if defined(OS_MACOSX) | 67 #if defined(OS_MACOSX) |
66 return ObsoleteSystemMac::LocalizedObsoleteSystemString(); | 68 return ObsoleteSystemMac::LocalizedObsoleteSystemString(); |
67 #elif defined(OS_WIN) | 69 #elif defined(OS_WIN) |
68 return l10n_util::GetStringUTF16(IDS_WIN_SSE_OBSOLETE_NOW); | 70 return l10n_util::GetStringUTF16(IDS_WIN_SSE_OBSOLETE_NOW); |
69 #else | 71 #else |
(...skipping 15 matching lines...) Expand all Loading... |
85 #if defined(OS_MACOSX) | 87 #if defined(OS_MACOSX) |
86 GURL(chrome::kMac32BitDeprecationURL), | 88 GURL(chrome::kMac32BitDeprecationURL), |
87 #else | 89 #else |
88 GURL("http://www.google.com/support/chrome/bin/answer.py?answer=95411"), | 90 GURL("http://www.google.com/support/chrome/bin/answer.py?answer=95411"), |
89 #endif | 91 #endif |
90 content::Referrer(), | 92 content::Referrer(), |
91 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, | 93 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, |
92 content::PAGE_TRANSITION_LINK, false)); | 94 content::PAGE_TRANSITION_LINK, false)); |
93 return false; | 95 return false; |
94 } | 96 } |
OLD | NEW |