Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "chrome/browser/infobars/infobar_service.h" | 10 #include "chrome/browser/infobars/infobar_service.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 // Returns true if the InfoBar should be closed automatically after the page | 71 // Returns true if the InfoBar should be closed automatically after the page |
| 72 // is navigated. By default this returns true if the navigation is to a new | 72 // is navigated. By default this returns true if the navigation is to a new |
| 73 // page (not including reloads). Subclasses wishing to change this behavior | 73 // page (not including reloads). Subclasses wishing to change this behavior |
| 74 // can override either this function or ShouldExpireInternal(), depending on | 74 // can override either this function or ShouldExpireInternal(), depending on |
| 75 // what level of control they need. | 75 // what level of control they need. |
| 76 virtual bool ShouldExpire(const content::LoadCommittedDetails& details) const; | 76 virtual bool ShouldExpire(const content::LoadCommittedDetails& details) const; |
| 77 | 77 |
| 78 // Called when the user clicks on the close button to dismiss the infobar. | 78 // Called when the user clicks on the close button to dismiss the infobar. |
| 79 virtual void InfoBarDismissed(); | 79 virtual void InfoBarDismissed(); |
| 80 | 80 |
| 81 // Return the resource ID of the icon to be shown for this InfoBar. If the | |
| 82 // value is -1, no icon is shown. | |
| 83 virtual int GetIconID() const; | |
| 84 | |
| 81 // Return the icon to be shown for this InfoBar. If the returned Image is | 85 // Return the icon to be shown for this InfoBar. If the returned Image is |
| 82 // NULL, no icon is shown. | 86 // NULL, no icon is shown. |
| 83 virtual gfx::Image* GetIcon() const; | 87 gfx::Image* GetIcon() const; |
|
Peter Kasting
2013/05/14 00:50:50
Nit: Move this function below the other public fun
gone
2013/05/14 17:50:17
Done.
| |
| 84 | 88 |
| 85 // Returns the type of the infobar. The type determines the appearance (such | 89 // Returns the type of the infobar. The type determines the appearance (such |
| 86 // as background color) of the infobar. | 90 // as background color) of the infobar. |
| 87 virtual Type GetInfoBarType() const; | 91 virtual Type GetInfoBarType() const; |
| 88 | 92 |
| 89 // Type-checking downcast routines: | 93 // Type-checking downcast routines: |
| 90 virtual AutoLoginInfoBarDelegate* AsAutoLoginInfoBarDelegate(); | 94 virtual AutoLoginInfoBarDelegate* AsAutoLoginInfoBarDelegate(); |
| 91 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate(); | 95 virtual ConfirmInfoBarDelegate* AsConfirmInfoBarDelegate(); |
| 92 virtual ExtensionInfoBarDelegate* AsExtensionInfoBarDelegate(); | 96 virtual ExtensionInfoBarDelegate* AsExtensionInfoBarDelegate(); |
| 93 virtual InsecureContentInfoBarDelegate* AsInsecureContentInfoBarDelegate(); | 97 virtual InsecureContentInfoBarDelegate* AsInsecureContentInfoBarDelegate(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 // opened for. Used to help expire on navigations. | 132 // opened for. Used to help expire on navigations. |
| 129 int contents_unique_id_; | 133 int contents_unique_id_; |
| 130 | 134 |
| 131 // TODO(pkasting): Remove. | 135 // TODO(pkasting): Remove. |
| 132 InfoBarService* owner_; | 136 InfoBarService* owner_; |
| 133 | 137 |
| 134 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); | 138 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); |
| 135 }; | 139 }; |
| 136 | 140 |
| 137 #endif // CHROME_BROWSER_INFOBARS_INFOBAR_DELEGATE_H_ | 141 #endif // CHROME_BROWSER_INFOBARS_INFOBAR_DELEGATE_H_ |
| OLD | NEW |