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

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

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit again Created 4 years, 11 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
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"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 SessionCrashedInfoBarDelegate::~SessionCrashedInfoBarDelegate() { 50 SessionCrashedInfoBarDelegate::~SessionCrashedInfoBarDelegate() {
51 // If the info bar wasn't accepted, it was either dismissed or expired. In 51 // If the info bar wasn't accepted, it was either dismissed or expired. In
52 // that case, session restore won't happen. 52 // that case, session restore won't happen.
53 if (!accepted_) { 53 if (!accepted_) {
54 content::BrowserContext::GetDefaultStoragePartition(profile_)-> 54 content::BrowserContext::GetDefaultStoragePartition(profile_)->
55 GetDOMStorageContext()->StartScavengingUnusedSessionStorage(); 55 GetDOMStorageContext()->StartScavengingUnusedSessionStorage();
56 } 56 }
57 } 57 }
58 58
59 infobars::InfoBarDelegate::InfoBarIdentifier
60 SessionCrashedInfoBarDelegate::GetIdentifier() const {
61 return SESSION_CRASHED_INFOBAR_DELEGATE;
62 }
63
59 int SessionCrashedInfoBarDelegate::GetIconId() const { 64 int SessionCrashedInfoBarDelegate::GetIconId() const {
60 return IDR_INFOBAR_RESTORE_SESSION; 65 return IDR_INFOBAR_RESTORE_SESSION;
61 } 66 }
62 67
63 gfx::VectorIconId SessionCrashedInfoBarDelegate::GetVectorIconId() const { 68 gfx::VectorIconId SessionCrashedInfoBarDelegate::GetVectorIconId() const {
64 #if defined(OS_MACOSX) 69 #if defined(OS_MACOSX)
65 return gfx::VectorIconId::VECTOR_ICON_NONE; 70 return gfx::VectorIconId::VECTOR_ICON_NONE;
66 #else 71 #else
67 return gfx::VectorIconId::SAD_TAB; 72 return gfx::VectorIconId::SAD_TAB;
68 #endif 73 #endif
(...skipping 13 matching lines...) Expand all
82 return l10n_util::GetStringUTF16(IDS_SESSION_CRASHED_VIEW_RESTORE_BUTTON); 87 return l10n_util::GetStringUTF16(IDS_SESSION_CRASHED_VIEW_RESTORE_BUTTON);
83 } 88 }
84 89
85 bool SessionCrashedInfoBarDelegate::Accept() { 90 bool SessionCrashedInfoBarDelegate::Accept() {
86 Browser* browser = chrome::FindBrowserWithWebContents( 91 Browser* browser = chrome::FindBrowserWithWebContents(
87 InfoBarService::WebContentsFromInfoBar(infobar())); 92 InfoBarService::WebContentsFromInfoBar(infobar()));
88 SessionRestore::RestoreSessionAfterCrash(browser); 93 SessionRestore::RestoreSessionAfterCrash(browser);
89 accepted_ = true; 94 accepted_ = true;
90 return true; 95 return true;
91 } 96 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698