Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Side by Side Diff: chrome/browser/ui/startup/session_crashed_infobar_delegate.cc

Issue 2382563003: Remove some more desktop infobar PNGs. (Closed)
Patch Set: pkasting review Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/startup/session_crashed_infobar_delegate.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/grit/theme_resources.h"
19 #include "components/infobars/core/infobar.h" 18 #include "components/infobars/core/infobar.h"
20 #include "components/strings/grit/components_chromium_strings.h" 19 #include "components/strings/grit/components_chromium_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 "ui/base/l10n/l10n_util.h" 23 #include "ui/base/l10n/l10n_util.h"
25 #include "ui/gfx/vector_icons_public.h" 24 #include "ui/gfx/vector_icons_public.h"
26 25
27 // static 26 // static
28 void SessionCrashedInfoBarDelegate::Create(Browser* browser) { 27 void SessionCrashedInfoBarDelegate::Create(Browser* browser) {
(...skipping 27 matching lines...) Expand all
56 content::BrowserContext::GetDefaultStoragePartition(profile_)-> 55 content::BrowserContext::GetDefaultStoragePartition(profile_)->
57 GetDOMStorageContext()->StartScavengingUnusedSessionStorage(); 56 GetDOMStorageContext()->StartScavengingUnusedSessionStorage();
58 } 57 }
59 } 58 }
60 59
61 infobars::InfoBarDelegate::InfoBarIdentifier 60 infobars::InfoBarDelegate::InfoBarIdentifier
62 SessionCrashedInfoBarDelegate::GetIdentifier() const { 61 SessionCrashedInfoBarDelegate::GetIdentifier() const {
63 return SESSION_CRASHED_INFOBAR_DELEGATE; 62 return SESSION_CRASHED_INFOBAR_DELEGATE;
64 } 63 }
65 64
66 int SessionCrashedInfoBarDelegate::GetIconId() const {
67 return IDR_INFOBAR_RESTORE_SESSION;
68 }
69
70 gfx::VectorIconId SessionCrashedInfoBarDelegate::GetVectorIconId() const { 65 gfx::VectorIconId SessionCrashedInfoBarDelegate::GetVectorIconId() const {
71 #if defined(OS_MACOSX)
72 return gfx::VectorIconId::VECTOR_ICON_NONE;
73 #else
74 return gfx::VectorIconId::SAD_TAB; 66 return gfx::VectorIconId::SAD_TAB;
75 #endif
76 } 67 }
77 68
78 base::string16 SessionCrashedInfoBarDelegate::GetMessageText() const { 69 base::string16 SessionCrashedInfoBarDelegate::GetMessageText() const {
79 return l10n_util::GetStringUTF16(IDS_SESSION_CRASHED_VIEW_MESSAGE); 70 return l10n_util::GetStringUTF16(IDS_SESSION_CRASHED_VIEW_MESSAGE);
80 } 71 }
81 72
82 int SessionCrashedInfoBarDelegate::GetButtons() const { 73 int SessionCrashedInfoBarDelegate::GetButtons() const {
83 return BUTTON_OK; 74 return BUTTON_OK;
84 } 75 }
85 76
86 base::string16 SessionCrashedInfoBarDelegate::GetButtonLabel( 77 base::string16 SessionCrashedInfoBarDelegate::GetButtonLabel(
87 InfoBarButton button) const { 78 InfoBarButton button) const {
88 DCHECK_EQ(BUTTON_OK, button); 79 DCHECK_EQ(BUTTON_OK, button);
89 return l10n_util::GetStringUTF16(IDS_SESSION_CRASHED_VIEW_RESTORE_BUTTON); 80 return l10n_util::GetStringUTF16(IDS_SESSION_CRASHED_VIEW_RESTORE_BUTTON);
90 } 81 }
91 82
92 bool SessionCrashedInfoBarDelegate::Accept() { 83 bool SessionCrashedInfoBarDelegate::Accept() {
93 Browser* browser = chrome::FindBrowserWithWebContents( 84 Browser* browser = chrome::FindBrowserWithWebContents(
94 InfoBarService::WebContentsFromInfoBar(infobar())); 85 InfoBarService::WebContentsFromInfoBar(infobar()));
95 SessionRestore::RestoreSessionAfterCrash(browser); 86 SessionRestore::RestoreSessionAfterCrash(browser);
96 accepted_ = true; 87 accepted_ = true;
97 return true; 88 return true;
98 } 89 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/session_crashed_infobar_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698