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

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

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 5 years 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 #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 "components/infobars/core/confirm_infobar_delegate.h" 8 #include "components/infobars/core/confirm_infobar_delegate.h"
9 9
10 class Browser; 10 class Browser;
11 class Profile; 11 class Profile;
12 12
13 // A delegate for the InfoBar shown when the previous session has crashed. 13 // A delegate for the InfoBar shown when the previous session has crashed.
14 class SessionCrashedInfoBarDelegate : public ConfirmInfoBarDelegate { 14 class SessionCrashedInfoBarDelegate : public ConfirmInfoBarDelegate {
15 public: 15 public:
16 // If |browser| is not incognito, creates a session crashed infobar and 16 // If |browser| is not incognito, creates a session crashed infobar and
17 // delegate and adds the infobar to the InfoBarService for |browser|. 17 // delegate and adds the infobar to the InfoBarService for |browser|.
18 static void Create(Browser* browser); 18 static void Create(Browser* browser);
19 19
20 private: 20 private:
21 explicit SessionCrashedInfoBarDelegate(Profile* profile); 21 explicit SessionCrashedInfoBarDelegate(Profile* profile);
22 ~SessionCrashedInfoBarDelegate() override; 22 ~SessionCrashedInfoBarDelegate() override;
23 23
24 // ConfirmInfoBarDelegate: 24 // ConfirmInfoBarDelegate:
25 std::string GetIdentifier() const override;
25 int GetIconId() const override; 26 int GetIconId() const override;
26 gfx::VectorIconId GetVectorIconId() const override; 27 gfx::VectorIconId GetVectorIconId() const override;
27 base::string16 GetMessageText() const override; 28 base::string16 GetMessageText() const override;
28 int GetButtons() const override; 29 int GetButtons() const override;
29 base::string16 GetButtonLabel(InfoBarButton button) const override; 30 base::string16 GetButtonLabel(InfoBarButton button) const override;
30 bool Accept() override; 31 bool Accept() override;
31 32
32 bool accepted_; 33 bool accepted_;
33 Profile* profile_; 34 Profile* profile_;
34 35
35 DISALLOW_COPY_AND_ASSIGN(SessionCrashedInfoBarDelegate); 36 DISALLOW_COPY_AND_ASSIGN(SessionCrashedInfoBarDelegate);
36 }; 37 };
37 38
38 #endif // CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_INFOBAR_DELEGATE_H_ 39 #endif // CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_INFOBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698