| 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_os_prompt.h" | 5 #include "chrome/browser/ui/startup/obsolete_os_prompt.h" |
| 6 | 6 |
| 7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
| 8 #include "chrome/browser/infobars/infobar_tab_helper.h" | 8 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/startup/obsolete_os_info_bar.h" | 10 #include "chrome/browser/ui/startup/obsolete_os_info_bar.h" |
| 11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 11 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 12 #include "grit/chromium_strings.h" | 12 #include "grit/chromium_strings.h" |
| 13 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
| 14 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 // The URL for the Mac OS X 10.5 deprecation help center article. | 18 // The URL for the Mac OS X 10.5 deprecation help center article. |
| 19 const char kMacLeopardDeprecationUrl[] = | 19 const char kMacLeopardDeprecationUrl[] = |
| 20 "https://support.google.com/chrome/?p=ui_mac_leopard_support"; | 20 "https://support.google.com/chrome/?p=ui_mac_leopard_support"; |
| 21 | 21 |
| 22 } // namespace | 22 } // namespace |
| 23 | 23 |
| 24 namespace browser { | 24 namespace browser { |
| 25 | 25 |
| 26 void ShowObsoleteOSPrompt(Browser* browser) { | 26 void ShowObsoleteOSPrompt(Browser* browser) { |
| 27 if (!base::mac::IsOSLeopard()) | 27 if (!base::mac::IsOSLeopard()) |
| 28 return; | 28 return; |
| 29 | 29 |
| 30 TabContentsWrapper* tab = browser->GetSelectedTabContentsWrapper(); | 30 TabContents* tab = browser->GetActiveTabContents(); |
| 31 if (!tab) | 31 if (!tab) |
| 32 return; | 32 return; |
| 33 tab->infobar_tab_helper()->AddInfoBar( | 33 tab->infobar_tab_helper()->AddInfoBar( |
| 34 new ObsoleteOSInfoBar( | 34 new ObsoleteOSInfoBar( |
| 35 tab->infobar_tab_helper(), | 35 tab->infobar_tab_helper(), |
| 36 l10n_util::GetStringFUTF16(IDS_MAC_10_5_LEOPARD_DEPRECATED, | 36 l10n_util::GetStringFUTF16(IDS_MAC_10_5_LEOPARD_DEPRECATED, |
| 37 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), | 37 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)), |
| 38 GURL(kMacLeopardDeprecationUrl))); | 38 GURL(kMacLeopardDeprecationUrl))); |
| 39 } | 39 } |
| 40 | 40 |
| 41 } // namespace browser | 41 } // namespace browser |
| OLD | NEW |