| 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 #ifndef CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_PROMPT_H_ | 5 #ifndef CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_PROMPT_H_ |
| 6 #define CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_PROMPT_H_ | 6 #define CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_PROMPT_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/infobars/confirm_infobar_delegate.h" | 8 #include "chrome/browser/infobars/confirm_infobar_delegate.h" |
| 9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
| 10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
| 11 | 11 |
| 12 class Browser; | 12 class Browser; |
| 13 | 13 |
| 14 // A delegate for the InfoBar shown when the previous session has crashed. | 14 // A delegate for the InfoBar shown when the previous session has crashed. |
| 15 class SessionCrashedInfoBarDelegate : public ConfirmInfoBarDelegate, | 15 class SessionCrashedInfoBarDelegate : public ConfirmInfoBarDelegate, |
| 16 public content::NotificationObserver { | 16 public content::NotificationObserver { |
| 17 public: | 17 public: |
| 18 // If |browser| is not incognito, creates a session crashed delegate and adds | 18 // If |browser| is not incognito, creates a session crashed delegate and adds |
| 19 // it to the InfoBarService for |browser|. | 19 // it to the InfoBarService for |browser|. |
| 20 static void Create(Browser* browser); | 20 static void Create(Browser* browser); |
| 21 | 21 |
| 22 private: | 22 private: |
| 23 SessionCrashedInfoBarDelegate(InfoBarService* infobar_service, | 23 SessionCrashedInfoBarDelegate(InfoBarService* infobar_service, |
| 24 Browser* browser); | 24 Browser* browser); |
| 25 virtual ~SessionCrashedInfoBarDelegate(); | 25 virtual ~SessionCrashedInfoBarDelegate(); |
| 26 | 26 |
| 27 // ConfirmInfoBarDelegate: | 27 // ConfirmInfoBarDelegate: |
| 28 virtual gfx::Image* GetIcon() const OVERRIDE; | 28 virtual int GetIconID() const OVERRIDE; |
| 29 virtual string16 GetMessageText() const OVERRIDE; | 29 virtual string16 GetMessageText() const OVERRIDE; |
| 30 virtual int GetButtons() const OVERRIDE; | 30 virtual int GetButtons() const OVERRIDE; |
| 31 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; | 31 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; |
| 32 virtual bool Accept() OVERRIDE; | 32 virtual bool Accept() OVERRIDE; |
| 33 | 33 |
| 34 // content::NotificationObserver: | 34 // content::NotificationObserver: |
| 35 virtual void Observe(int type, | 35 virtual void Observe(int type, |
| 36 const content::NotificationSource& source, | 36 const content::NotificationSource& source, |
| 37 const content::NotificationDetails& details) OVERRIDE; | 37 const content::NotificationDetails& details) OVERRIDE; |
| 38 | 38 |
| 39 content::NotificationRegistrar registrar_; | 39 content::NotificationRegistrar registrar_; |
| 40 bool accepted_; | 40 bool accepted_; |
| 41 bool removed_notification_received_; | 41 bool removed_notification_received_; |
| 42 Browser* browser_; | 42 Browser* browser_; |
| 43 | 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(SessionCrashedInfoBarDelegate); | 44 DISALLOW_COPY_AND_ASSIGN(SessionCrashedInfoBarDelegate); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 #endif // CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_PROMPT_H_ | 47 #endif // CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_PROMPT_H_ |
| OLD | NEW |