| 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/logging.h" | 7 #include "base/logging.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/browser_tabstrip.h" | 10 #include "chrome/browser/ui/browser_tabstrip.h" |
| 11 #include "chrome/browser/ui/gtk/gtk_util.h" | 11 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 12 #include "chrome/browser/ui/startup/obsolete_os_info_bar.h" | 12 #include "chrome/browser/ui/startup/obsolete_os_info_bar.h" |
| 13 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 13 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 14 #include "grit/chromium_strings.h" | 14 #include "grit/chromium_strings.h" |
| 15 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 17 | 17 |
| 18 namespace browser { | 18 namespace chrome { |
| 19 | 19 |
| 20 void ShowObsoleteOSPrompt(Browser* browser) { | 20 void ShowObsoleteOSPrompt(Browser* browser) { |
| 21 // We've deprecated support for Ubuntu Hardy. Rather than attempting to | 21 // We've deprecated support for Ubuntu Hardy. Rather than attempting to |
| 22 // determine whether you're using that, we instead key off the GTK version; | 22 // determine whether you're using that, we instead key off the GTK version; |
| 23 // this will also deprecate other distributions (including variants of Ubuntu) | 23 // this will also deprecate other distributions (including variants of Ubuntu) |
| 24 // that are of a similar age. | 24 // that are of a similar age. |
| 25 // Version key: | 25 // Version key: |
| 26 // Ubuntu Hardy: GTK 2.12 | 26 // Ubuntu Hardy: GTK 2.12 |
| 27 // RHEL 6: GTK 2.18 | 27 // RHEL 6: GTK 2.18 |
| 28 // Ubuntu Lucid: GTK 2.20 | 28 // Ubuntu Lucid: GTK 2.20 |
| 29 if (gtk_check_version(2, 18, 0)) { | 29 if (gtk_check_version(2, 18, 0)) { |
| 30 string16 message = l10n_util::GetStringUTF16(IDS_SYSTEM_OBSOLETE_MESSAGE); | 30 string16 message = l10n_util::GetStringUTF16(IDS_SYSTEM_OBSOLETE_MESSAGE); |
| 31 // Link to an article in the help center on minimum system requirements. | 31 // Link to an article in the help center on minimum system requirements. |
| 32 const char* kLearnMoreURL = | 32 const char* kLearnMoreURL = |
| 33 "http://www.google.com/support/chrome/bin/answer.py?answer=95411"; | 33 "http://www.google.com/support/chrome/bin/answer.py?answer=95411"; |
| 34 TabContents* tab = chrome::GetActiveTabContents(browser); | 34 TabContents* tab = chrome::GetActiveTabContents(browser); |
| 35 if (!tab) | 35 if (!tab) |
| 36 return; | 36 return; |
| 37 tab->infobar_tab_helper()->AddInfoBar( | 37 tab->infobar_tab_helper()->AddInfoBar( |
| 38 new ObsoleteOSInfoBar(tab->infobar_tab_helper(), | 38 new ObsoleteOSInfoBar(tab->infobar_tab_helper(), |
| 39 message, | 39 message, |
| 40 GURL(kLearnMoreURL))); | 40 GURL(kLearnMoreURL))); |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace browser | 44 } // namespace chrome |
| OLD | NEW |