#ifndef CHROME_BROWSER_UI_AUTO_LOGIN_INFOBAR_DELEGATE_H_
#define CHROME_BROWSER_UI_AUTO_LOGIN_INFOBAR_DELEGATE_H_
#include <string>
#include "chrome/browser/infobars/confirm_infobar_delegate.h"
#include "components/auto_login_parser/auto_login_parser.h"
#include "components/signin/core/browser/signin_manager.h"
class PrefService;
class Profile;
namespace content {
class NavigationController;
}
class AutoLoginInfoBarDelegate : public ConfirmInfoBarDelegate,
public SigninManagerBase::Observer {
public:
struct Params {
auto_login_parser::HeaderData header;
std::string username;
};
static bool Create(content::WebContents* web_contents, const Params& params);
protected:
AutoLoginInfoBarDelegate(const Params& params, Profile* profile);
virtual ~AutoLoginInfoBarDelegate();
private:
enum Actions {
SHOWN,
ACCEPTED,
REJECTED,
DISMISSED,
IGNORED,
LEARN_MORE,
HISTOGRAM_BOUNDING_VALUE
};
virtual void InfoBarDismissed() OVERRIDE;
virtual int GetIconID() const OVERRIDE;
virtual Type GetInfoBarType() const OVERRIDE;
virtual AutoLoginInfoBarDelegate* AsAutoLoginInfoBarDelegate() OVERRIDE;
virtual base::string16 GetMessageText() const OVERRIDE;
virtual base::string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
virtual bool Accept() OVERRIDE;
virtual bool Cancel() OVERRIDE;
virtual void GoogleSignedOut(const std::string& username) OVERRIDE;
void RecordHistogramAction(Actions action);
const Params params_;
Profile* profile_;
bool button_pressed_;
DISALLOW_COPY_AND_ASSIGN(AutoLoginInfoBarDelegate);
};
#endif