| 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_infobar_delegate.h" | 5 #include "chrome/browser/ui/startup/session_crashed_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/app/vector_icons/vector_icons.h" | 8 #include "chrome/app/vector_icons/vector_icons.h" |
| 9 #include "chrome/browser/infobars/infobar_service.h" | 9 #include "chrome/browser/infobars/infobar_service.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/search/search.h" | 11 #include "chrome/browser/search/search.h" |
| 12 #include "chrome/browser/sessions/session_restore.h" | 12 #include "chrome/browser/sessions/session_restore.h" |
| 13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/browser_finder.h" | 14 #include "chrome/browser/ui/browser_finder.h" |
| 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 16 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
| 17 #include "chrome/grit/chromium_strings.h" | |
| 18 #include "chrome/grit/generated_resources.h" | |
| 19 #include "components/infobars/core/infobar.h" | 17 #include "components/infobars/core/infobar.h" |
| 20 #include "components/strings/grit/components_chromium_strings.h" | 18 #include "components/strings/grit/components_chromium_strings.h" |
| 21 #include "components/strings/grit/components_strings.h" | 19 #include "components/strings/grit/components_strings.h" |
| 22 #include "content/public/browser/dom_storage_context.h" | 20 #include "content/public/browser/dom_storage_context.h" |
| 23 #include "content/public/browser/storage_partition.h" | 21 #include "content/public/browser/storage_partition.h" |
| 24 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 25 | 23 |
| 26 // static | 24 // static |
| 27 void SessionCrashedInfoBarDelegate::Create(Browser* browser) { | 25 void SessionCrashedInfoBarDelegate::Create(Browser* browser) { |
| 28 // Assume that if the user is launching incognito they were previously running | 26 // Assume that if the user is launching incognito they were previously running |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 return l10n_util::GetStringUTF16(IDS_SESSION_CRASHED_VIEW_RESTORE_BUTTON); | 78 return l10n_util::GetStringUTF16(IDS_SESSION_CRASHED_VIEW_RESTORE_BUTTON); |
| 81 } | 79 } |
| 82 | 80 |
| 83 bool SessionCrashedInfoBarDelegate::Accept() { | 81 bool SessionCrashedInfoBarDelegate::Accept() { |
| 84 Browser* browser = chrome::FindBrowserWithWebContents( | 82 Browser* browser = chrome::FindBrowserWithWebContents( |
| 85 InfoBarService::WebContentsFromInfoBar(infobar())); | 83 InfoBarService::WebContentsFromInfoBar(infobar())); |
| 86 SessionRestore::RestoreSessionAfterCrash(browser); | 84 SessionRestore::RestoreSessionAfterCrash(browser); |
| 87 accepted_ = true; | 85 accepted_ = true; |
| 88 return true; | 86 return true; |
| 89 } | 87 } |
| OLD | NEW |