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/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/search/search.h" | 10 #include "chrome/browser/search/search.h" |
11 #include "chrome/browser/sessions/session_restore.h" | 11 #include "chrome/browser/sessions/session_restore.h" |
12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/browser_finder.h" | 13 #include "chrome/browser/ui/browser_finder.h" |
14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
15 #include "chrome/common/url_constants.h" | 15 #include "chrome/common/url_constants.h" |
16 #include "chrome/grit/chromium_strings.h" | 16 #include "chrome/grit/chromium_strings.h" |
17 #include "chrome/grit/generated_resources.h" | 17 #include "chrome/grit/generated_resources.h" |
18 #include "components/infobars/core/infobar.h" | 18 #include "components/infobars/core/infobar.h" |
19 #include "components/strings/grit/components_chromium_strings.h" | 19 #include "components/strings/grit/components_chromium_strings.h" |
20 #include "components/strings/grit/components_google_chrome_strings.h" | |
21 #include "components/strings/grit/components_strings.h" | 20 #include "components/strings/grit/components_strings.h" |
22 #include "content/public/browser/dom_storage_context.h" | 21 #include "content/public/browser/dom_storage_context.h" |
23 #include "content/public/browser/storage_partition.h" | 22 #include "content/public/browser/storage_partition.h" |
24 #include "grit/theme_resources.h" | 23 #include "grit/theme_resources.h" |
25 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
26 #include "ui/gfx/vector_icons_public.h" | 25 #include "ui/gfx/vector_icons_public.h" |
27 | 26 |
28 // static | 27 // static |
29 void SessionCrashedInfoBarDelegate::Create(Browser* browser) { | 28 void SessionCrashedInfoBarDelegate::Create(Browser* browser) { |
30 // Assume that if the user is launching incognito they were previously running | 29 // Assume that if the user is launching incognito they were previously running |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 return l10n_util::GetStringUTF16(IDS_SESSION_CRASHED_VIEW_RESTORE_BUTTON); | 89 return l10n_util::GetStringUTF16(IDS_SESSION_CRASHED_VIEW_RESTORE_BUTTON); |
91 } | 90 } |
92 | 91 |
93 bool SessionCrashedInfoBarDelegate::Accept() { | 92 bool SessionCrashedInfoBarDelegate::Accept() { |
94 Browser* browser = chrome::FindBrowserWithWebContents( | 93 Browser* browser = chrome::FindBrowserWithWebContents( |
95 InfoBarService::WebContentsFromInfoBar(infobar())); | 94 InfoBarService::WebContentsFromInfoBar(infobar())); |
96 SessionRestore::RestoreSessionAfterCrash(browser); | 95 SessionRestore::RestoreSessionAfterCrash(browser); |
97 accepted_ = true; | 96 accepted_ = true; |
98 return true; | 97 return true; |
99 } | 98 } |
OLD | NEW |