| 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_service.h" | 7 #include "chrome/browser/infobars/infobar_service.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/search/search.h" | 9 #include "chrome/browser/search/search.h" |
| 10 #include "chrome/browser/sessions/session_restore.h" | 10 #include "chrome/browser/sessions/session_restore.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 SessionCrashedInfoBarDelegate::~SessionCrashedInfoBarDelegate() { | 61 SessionCrashedInfoBarDelegate::~SessionCrashedInfoBarDelegate() { |
| 62 // If the info bar wasn't accepted, it was either dismissed or expired. In | 62 // If the info bar wasn't accepted, it was either dismissed or expired. In |
| 63 // that case, session restore won't happen. | 63 // that case, session restore won't happen. |
| 64 if (!accepted_ && !removed_notification_received_) { | 64 if (!accepted_ && !removed_notification_received_) { |
| 65 content::BrowserContext::GetDefaultStoragePartition(browser_->profile())-> | 65 content::BrowserContext::GetDefaultStoragePartition(browser_->profile())-> |
| 66 GetDOMStorageContext()->StartScavengingUnusedSessionStorage(); | 66 GetDOMStorageContext()->StartScavengingUnusedSessionStorage(); |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 gfx::Image* SessionCrashedInfoBarDelegate::GetIcon() const { | 70 int SessionCrashedInfoBarDelegate::GetIconID() const { |
| 71 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 71 return IDR_INFOBAR_RESTORE_SESSION; |
| 72 IDR_INFOBAR_RESTORE_SESSION); | |
| 73 } | 72 } |
| 74 | 73 |
| 75 string16 SessionCrashedInfoBarDelegate::GetMessageText() const { | 74 string16 SessionCrashedInfoBarDelegate::GetMessageText() const { |
| 76 return l10n_util::GetStringUTF16(IDS_SESSION_CRASHED_VIEW_MESSAGE); | 75 return l10n_util::GetStringUTF16(IDS_SESSION_CRASHED_VIEW_MESSAGE); |
| 77 } | 76 } |
| 78 | 77 |
| 79 int SessionCrashedInfoBarDelegate::GetButtons() const { | 78 int SessionCrashedInfoBarDelegate::GetButtons() const { |
| 80 return BUTTON_OK; | 79 return BUTTON_OK; |
| 81 } | 80 } |
| 82 | 81 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 112 DCHECK(type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED); | 111 DCHECK(type == chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED); |
| 113 if (content::Details<std::pair<InfoBarDelegate*, bool> >(details)->first != | 112 if (content::Details<std::pair<InfoBarDelegate*, bool> >(details)->first != |
| 114 this) | 113 this) |
| 115 return; | 114 return; |
| 116 if (!accepted_) { | 115 if (!accepted_) { |
| 117 content::BrowserContext::GetDefaultStoragePartition(browser_->profile())-> | 116 content::BrowserContext::GetDefaultStoragePartition(browser_->profile())-> |
| 118 GetDOMStorageContext()->StartScavengingUnusedSessionStorage(); | 117 GetDOMStorageContext()->StartScavengingUnusedSessionStorage(); |
| 119 removed_notification_received_ = true; | 118 removed_notification_received_ = true; |
| 120 } | 119 } |
| 121 } | 120 } |
| OLD | NEW |