| 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/session_crashed_prompt.h" | 5 #include "chrome/browser/ui/startup/session_crashed_prompt.h" |
| 6 | 6 |
| 7 #include "chrome/browser/infobars/infobar_tab_helper.h" | 7 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/sessions/session_restore.h" | 9 #include "chrome/browser/sessions/session_restore.h" |
| 10 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 10 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
| 11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/browser_finder.h" | 12 #include "chrome/browser/ui/browser_finder.h" |
| 13 #include "chrome/browser/ui/browser_tabstrip.h" | 13 #include "chrome/browser/ui/browser_tabstrip.h" |
| 14 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 14 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 15 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
| 16 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
| 17 #include "grit/chromium_strings.h" | 17 #include "grit/chromium_strings.h" |
| 18 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
| 19 #include "grit/theme_resources.h" | 19 #include "grit/theme_resources.h" |
| 20 #include "grit/theme_resources_standard.h" | |
| 21 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| 22 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
| 23 | 22 |
| 24 namespace { | 23 namespace { |
| 25 | 24 |
| 26 // A delegate for the InfoBar shown when the previous session has crashed. | 25 // A delegate for the InfoBar shown when the previous session has crashed. |
| 27 class SessionCrashedInfoBarDelegate : public ConfirmInfoBarDelegate { | 26 class SessionCrashedInfoBarDelegate : public ConfirmInfoBarDelegate { |
| 28 public: | 27 public: |
| 29 explicit SessionCrashedInfoBarDelegate(InfoBarTabHelper* infobar_helper); | 28 explicit SessionCrashedInfoBarDelegate(InfoBarTabHelper* infobar_helper); |
| 30 | 29 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 101 |
| 103 // Don't show the info-bar if there are already info-bars showing. | 102 // Don't show the info-bar if there are already info-bars showing. |
| 104 if (tab->infobar_tab_helper()->infobar_count() > 0) | 103 if (tab->infobar_tab_helper()->infobar_count() > 0) |
| 105 return; | 104 return; |
| 106 | 105 |
| 107 tab->infobar_tab_helper()->AddInfoBar( | 106 tab->infobar_tab_helper()->AddInfoBar( |
| 108 new SessionCrashedInfoBarDelegate(tab->infobar_tab_helper())); | 107 new SessionCrashedInfoBarDelegate(tab->infobar_tab_helper())); |
| 109 } | 108 } |
| 110 | 109 |
| 111 } // namespace chrome | 110 } // namespace chrome |
| OLD | NEW |