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