15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch#ifndef CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_INFOBAR_DELEGATE_H_
6ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch#define CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_INFOBAR_DELEGATE_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
82a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "chrome/browser/infobars/confirm_infobar_delegate.h"
92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Browser;
11a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)class Profile;
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// A delegate for the InfoBar shown when the previous session has crashed.
14a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)class SessionCrashedInfoBarDelegate : public ConfirmInfoBarDelegate {
152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) public:
16a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  // If |browser| is not incognito, creates a session crashed infobar and
17a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  // delegate and adds the infobar to the InfoBarService for |browser|.
182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  static void Create(Browser* browser);
192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) private:
21a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  explicit SessionCrashedInfoBarDelegate(Profile* profile);
222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual ~SessionCrashedInfoBarDelegate();
232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  // ConfirmInfoBarDelegate:
2590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)  virtual int GetIconID() const OVERRIDE;
26a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual base::string16 GetMessageText() const OVERRIDE;
272a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual int GetButtons() const OVERRIDE;
28a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)  virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  virtual bool Accept() OVERRIDE;
302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  bool accepted_;
32a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)  Profile* profile_;
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(SessionCrashedInfoBarDelegate);
352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)};
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
37ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch#endif  // CHROME_BROWSER_UI_STARTUP_SESSION_CRASHED_INFOBAR_DELEGATE_H_
38