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_TAB_CONTENTS_CONFIRM_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_CONFIRM_INFOBAR_DELEGATE_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_CONFIRM_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_CONFIRM_INFOBAR_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 virtual int GetButtons() const; | 28 virtual int GetButtons() const; |
29 | 29 |
30 // Return the label for the specified button. The default implementation | 30 // Return the label for the specified button. The default implementation |
31 // returns "OK" for the OK button and "Cancel" for the Cancel button. | 31 // returns "OK" for the OK button and "Cancel" for the Cancel button. |
32 virtual string16 GetButtonLabel(InfoBarButton button) const; | 32 virtual string16 GetButtonLabel(InfoBarButton button) const; |
33 | 33 |
34 // Return whether or not the specified button needs elevation. | 34 // Return whether or not the specified button needs elevation. |
35 virtual bool NeedElevation(InfoBarButton button) const; | 35 virtual bool NeedElevation(InfoBarButton button) const; |
36 | 36 |
37 // Called when the OK button is pressed. If the function returns true, the | 37 // Called when the OK button is pressed. If the function returns true, the |
38 // InfoBarDelegate should be removed from the associated TabContents. | 38 // InfoBarDelegate should be removed from the associated TabContentsWrapper. |
39 virtual bool Accept(); | 39 virtual bool Accept(); |
40 | 40 |
41 // Called when the Cancel button is pressed. If the function returns true, | 41 // Called when the Cancel button is pressed. If the function returns true, |
42 // the InfoBarDelegate should be removed from the associated TabContents. | 42 // the InfoBarDelegate should be removed from the associated |
| 43 // TabContentsWrapper. |
43 virtual bool Cancel(); | 44 virtual bool Cancel(); |
44 | 45 |
45 // Returns the text of the link to be displayed, if any. Otherwise returns | 46 // Returns the text of the link to be displayed, if any. Otherwise returns |
46 // and empty string. | 47 // and empty string. |
47 virtual string16 GetLinkText(); | 48 virtual string16 GetLinkText(); |
48 | 49 |
49 // Called when the Link is clicked. The |disposition| specifies how the | 50 // Called when the Link is clicked. The |disposition| specifies how the |
50 // resulting document should be loaded (based on the event flags present when | 51 // resulting document should be loaded (based on the event flags present when |
51 // the link was clicked). This function returns true if the InfoBar should be | 52 // the link was clicked). This function returns true if the InfoBar should be |
52 // closed now or false if it should remain until the user explicitly closes | 53 // closed now or false if it should remain until the user explicitly closes |
53 // it. | 54 // it. |
54 // Will only be called if GetLinkText() returns non-empty string. | 55 // Will only be called if GetLinkText() returns non-empty string. |
55 virtual bool LinkClicked(WindowOpenDisposition disposition); | 56 virtual bool LinkClicked(WindowOpenDisposition disposition); |
56 | 57 |
57 protected: | 58 protected: |
58 explicit ConfirmInfoBarDelegate(TabContents* contents); | 59 explicit ConfirmInfoBarDelegate(TabContents* contents); |
59 virtual ~ConfirmInfoBarDelegate(); | 60 virtual ~ConfirmInfoBarDelegate(); |
60 | 61 |
61 private: | 62 private: |
62 // InfoBarDelegate: | 63 // InfoBarDelegate: |
63 virtual InfoBar* CreateInfoBar() OVERRIDE; | 64 virtual InfoBar* CreateInfoBar(TabContentsWrapper* owner) OVERRIDE; |
64 virtual bool EqualsDelegate(InfoBarDelegate* delegate) const OVERRIDE; | 65 virtual bool EqualsDelegate(InfoBarDelegate* delegate) const OVERRIDE; |
65 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate() OVERRIDE; | 66 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate() OVERRIDE; |
66 | 67 |
67 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBarDelegate); | 68 DISALLOW_COPY_AND_ASSIGN(ConfirmInfoBarDelegate); |
68 }; | 69 }; |
69 | 70 |
70 #endif // CHROME_BROWSER_TAB_CONTENTS_CONFIRM_INFOBAR_DELEGATE_H_ | 71 #endif // CHROME_BROWSER_TAB_CONTENTS_CONFIRM_INFOBAR_DELEGATE_H_ |
OLD | NEW |