| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ | 5 #ifndef COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ |
| 6 #define COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ | 6 #define COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "ui/base/window_open_disposition.h" | 10 #include "ui/base/window_open_disposition.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // Returns true if the InfoBar should be closed automatically after the page | 88 // Returns true if the InfoBar should be closed automatically after the page |
| 89 // is navigated. By default this returns true if the navigation is to a new | 89 // is navigated. By default this returns true if the navigation is to a new |
| 90 // page (not including reloads). Subclasses wishing to change this behavior | 90 // page (not including reloads). Subclasses wishing to change this behavior |
| 91 // can override either this function or ShouldExpireInternal(), depending on | 91 // can override either this function or ShouldExpireInternal(), depending on |
| 92 // what level of control they need. | 92 // what level of control they need. |
| 93 virtual bool ShouldExpire(const NavigationDetails& details) const; | 93 virtual bool ShouldExpire(const NavigationDetails& details) const; |
| 94 | 94 |
| 95 // Called when the user clicks on the close button to dismiss the infobar. | 95 // Called when the user clicks on the close button to dismiss the infobar. |
| 96 virtual void InfoBarDismissed(); | 96 virtual void InfoBarDismissed(); |
| 97 | 97 |
| 98 // Return the resource ID of the icon to be shown for this InfoBar. If the | 98 // Returns the resource ID of the icon to be shown for this InfoBar. If the |
| 99 // value is equal to |kNoIconID|, no icon is shown. | 99 // value is equal to |kNoIconID|, no icon is shown. |
| 100 virtual int GetIconID() const; | 100 virtual int GetIconID() const; |
| 101 | 101 |
| 102 // Returns the type of the infobar. The type determines the appearance (such | 102 // Returns the type of the infobar. The type determines the appearance (such |
| 103 // as background color) of the infobar. | 103 // as background color) of the infobar. |
| 104 virtual Type GetInfoBarType() const; | 104 virtual Type GetInfoBarType() const; |
| 105 | 105 |
| 106 // Type-checking downcast routines: | 106 // Type-checking downcast routines: |
| 107 virtual AutoLoginInfoBarDelegate* AsAutoLoginInfoBarDelegate(); | 107 virtual AutoLoginInfoBarDelegate* AsAutoLoginInfoBarDelegate(); |
| 108 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate(); | 108 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 // The InfoBar associated with us. | 143 // The InfoBar associated with us. |
| 144 InfoBar* infobar_; | 144 InfoBar* infobar_; |
| 145 | 145 |
| 146 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); | 146 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 } // namespace infobars | 149 } // namespace infobars |
| 150 | 150 |
| 151 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ | 151 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ |
| OLD | NEW |