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_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_INFOBAR_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_INFOBAR_DELEGATE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/infobars/core/confirm_infobar_delegate.h" | 9 #include "components/infobars/core/confirm_infobar_delegate.h" |
10 | 10 |
11 class Browser; | 11 class Browser; |
12 class Profile; | 12 class Profile; |
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: | 16 public: |
17 // If |browser| is not incognito, creates a session crashed infobar and | 17 // If |browser| is not incognito, creates a session crashed infobar and |
18 // delegate and adds the infobar to the InfoBarService for |browser|. | 18 // delegate and adds the infobar to the InfoBarService for |browser|. |
19 static void Create(Browser* browser); | 19 static void Create(Browser* browser); |
20 | 20 |
21 private: | 21 private: |
22 explicit SessionCrashedInfoBarDelegate(Profile* profile); | 22 explicit SessionCrashedInfoBarDelegate(Profile* profile); |
23 ~SessionCrashedInfoBarDelegate() override; | 23 ~SessionCrashedInfoBarDelegate() override; |
24 | 24 |
25 // ConfirmInfoBarDelegate: | 25 // ConfirmInfoBarDelegate: |
| 26 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
26 int GetIconId() const override; | 27 int GetIconId() const override; |
27 gfx::VectorIconId GetVectorIconId() const override; | 28 gfx::VectorIconId GetVectorIconId() const override; |
28 base::string16 GetMessageText() const override; | 29 base::string16 GetMessageText() const override; |
29 int GetButtons() const override; | 30 int GetButtons() const override; |
30 base::string16 GetButtonLabel(InfoBarButton button) const override; | 31 base::string16 GetButtonLabel(InfoBarButton button) const override; |
31 bool Accept() override; | 32 bool Accept() override; |
32 | 33 |
33 bool accepted_; | 34 bool accepted_; |
34 Profile* profile_; | 35 Profile* profile_; |
35 | 36 |
36 DISALLOW_COPY_AND_ASSIGN(SessionCrashedInfoBarDelegate); | 37 DISALLOW_COPY_AND_ASSIGN(SessionCrashedInfoBarDelegate); |
37 }; | 38 }; |
38 | 39 |
39 #endif // CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_INFOBAR_DELEGATE_H_ | 40 #endif // CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_INFOBAR_DELEGATE_H_ |
OLD | NEW |