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_INFOBARS_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_INFOBARS_INFOBAR_DELEGATE_H_ |
6 #define CHROME_BROWSER_INFOBARS_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_INFOBARS_INFOBAR_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 | 63 |
64 // Returns true if the InfoBar should be closed automatically after the page | 64 // Returns true if the InfoBar should be closed automatically after the page |
65 // is navigated. The default behavior is to return true if the | 65 // is navigated. The default behavior is to return true if the |
66 // navigation is to a new page (not including reloads). | 66 // navigation is to a new page (not including reloads). |
67 virtual bool ShouldExpire( | 67 virtual bool ShouldExpire( |
68 const content::LoadCommittedDetails& details) const; | 68 const content::LoadCommittedDetails& details) const; |
69 | 69 |
70 // Called when the user clicks on the close button to dismiss the infobar. | 70 // Called when the user clicks on the close button to dismiss the infobar. |
71 virtual void InfoBarDismissed(); | 71 virtual void InfoBarDismissed(); |
72 | 72 |
73 // Called when the infobar is about to close. | |
74 virtual void InfoBarClosing(); | |
75 | |
73 // Called after the InfoBar is closed. Deletes |this|. | 76 // Called after the InfoBar is closed. Deletes |this|. |
74 // TODO(pkasting): Get rid of this and delete delegates directly. | 77 // TODO(pkasting): Get rid of this and delete delegates directly. |
75 void InfoBarClosed(); | 78 void InfoBarClosed(); |
jochen (gone - plz use gerrit)
2011/11/25 14:45:14
why no make this a virtual method instead of addin
marja
2011/11/28 15:22:01
Then the subclass funcs would need to remember to
| |
76 | 79 |
77 // Return the icon to be shown for this InfoBar. If the returned Image is | 80 // Return the icon to be shown for this InfoBar. If the returned Image is |
78 // NULL, no icon is shown. | 81 // NULL, no icon is shown. |
79 virtual gfx::Image* GetIcon() const; | 82 virtual gfx::Image* GetIcon() const; |
80 | 83 |
81 // Returns the type of the infobar. The type determines the appearance (such | 84 // Returns the type of the infobar. The type determines the appearance (such |
82 // as background color) of the infobar. | 85 // as background color) of the infobar. |
83 virtual Type GetInfoBarType() const; | 86 virtual Type GetInfoBarType() const; |
84 | 87 |
85 // Type-checking downcast routines: | 88 // Type-checking downcast routines: |
(...skipping 28 matching lines...) Expand all Loading... | |
114 // opened for. Used to help expire on navigations. | 117 // opened for. Used to help expire on navigations. |
115 int contents_unique_id_; | 118 int contents_unique_id_; |
116 | 119 |
117 // TODO(pkasting): Remove. | 120 // TODO(pkasting): Remove. |
118 InfoBarTabHelper* owner_; | 121 InfoBarTabHelper* owner_; |
119 | 122 |
120 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); | 123 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); |
121 }; | 124 }; |
122 | 125 |
123 #endif // CHROME_BROWSER_INFOBARS_INFOBAR_DELEGATE_H_ | 126 #endif // CHROME_BROWSER_INFOBARS_INFOBAR_DELEGATE_H_ |
OLD | NEW |