autofill_cc_infobar_delegate.h revision 72a454cd3513ac24fbdd0e0cb9ad70b86a99b801
1// Copyright (c) 2011 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_CC_INFOBAR_DELEGATE_H_ 6#define CHROME_BROWSER_AUTOFILL_AUTOFILL_CC_INFOBAR_DELEGATE_H_ 7#pragma once 8 9#include "base/string16.h" 10#include "chrome/browser/tab_contents/infobar_delegate.h" 11 12class AutoFillManager; 13 14// An InfoBar delegate that enables the user to allow or deny storing credit 15// card information gathered from a form submission. 16class AutoFillCCInfoBarDelegate : public ConfirmInfoBarDelegate { 17 public: 18 AutoFillCCInfoBarDelegate(TabContents* tab_contents, AutoFillManager* host); 19 20 private: 21 virtual ~AutoFillCCInfoBarDelegate(); 22 23 // ConfirmInfoBarDelegate: 24 virtual bool ShouldExpire( 25 const NavigationController::LoadCommittedDetails& details) const; 26 virtual void InfoBarClosed(); 27 virtual SkBitmap* GetIcon() const; 28 virtual Type GetInfoBarType() const; 29 virtual string16 GetMessageText() const; 30 virtual string16 GetButtonLabel(InfoBarButton button) const; 31 virtual bool Accept(); 32 virtual bool Cancel(); 33 virtual string16 GetLinkText(); 34 virtual bool LinkClicked(WindowOpenDisposition disposition); 35 36#if defined(OS_WIN) 37 // Overridden from InfoBarDelegate: 38 virtual InfoBar* CreateInfoBar(); 39#endif // defined(OS_WIN) 40 41 // The AutoFillManager that initiated this InfoBar. 42 AutoFillManager* host_; 43 44 DISALLOW_COPY_AND_ASSIGN(AutoFillCCInfoBarDelegate); 45}; 46 47#endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_CC_INFOBAR_DELEGATE_H_ 48