| 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 after the InfoBar is closed. Deletes |this|. | |
| 74 // TODO(pkasting): Get rid of this and delete delegates directly. | |
| 75 void InfoBarClosed(); | |
| 76 | |
| 77 // Return the icon to be shown for this InfoBar. If the returned Image is | 73 // Return the icon to be shown for this InfoBar. If the returned Image is |
| 78 // NULL, no icon is shown. | 74 // NULL, no icon is shown. |
| 79 virtual gfx::Image* GetIcon() const; | 75 virtual gfx::Image* GetIcon() const; |
| 80 | 76 |
| 81 // Returns the type of the infobar. The type determines the appearance (such | 77 // Returns the type of the infobar. The type determines the appearance (such |
| 82 // as background color) of the infobar. | 78 // as background color) of the infobar. |
| 83 virtual Type GetInfoBarType() const; | 79 virtual Type GetInfoBarType() const; |
| 84 | 80 |
| 85 // Type-checking downcast routines: | 81 // Type-checking downcast routines: |
| 86 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate(); | 82 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 114 // opened for. Used to help expire on navigations. | 110 // opened for. Used to help expire on navigations. |
| 115 int contents_unique_id_; | 111 int contents_unique_id_; |
| 116 | 112 |
| 117 // TODO(pkasting): Remove. | 113 // TODO(pkasting): Remove. |
| 118 InfoBarTabHelper* owner_; | 114 InfoBarTabHelper* owner_; |
| 119 | 115 |
| 120 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); | 116 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); |
| 121 }; | 117 }; |
| 122 | 118 |
| 123 #endif // CHROME_BROWSER_INFOBARS_INFOBAR_DELEGATE_H_ | 119 #endif // CHROME_BROWSER_INFOBARS_INFOBAR_DELEGATE_H_ |
| OLD | NEW |