| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 class OfflinePageInfoBarDelegate; | 29 class OfflinePageInfoBarDelegate; |
| 30 } | 30 } |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 namespace translate { | 33 namespace translate { |
| 34 class TranslateInfoBarDelegate; | 34 class TranslateInfoBarDelegate; |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace gfx { | 37 namespace gfx { |
| 38 class Image; | 38 class Image; |
| 39 enum class VectorIconId; | 39 struct VectorIcon; |
| 40 } | 40 } |
| 41 | 41 |
| 42 namespace infobars { | 42 namespace infobars { |
| 43 | 43 |
| 44 class InfoBar; | 44 class InfoBar; |
| 45 | 45 |
| 46 // An interface implemented by objects wishing to control an InfoBar. | 46 // An interface implemented by objects wishing to control an InfoBar. |
| 47 // Implementing this interface is not sufficient to use an InfoBar, since it | 47 // Implementing this interface is not sufficient to use an InfoBar, since it |
| 48 // does not map to a specific InfoBar type. Instead, you must implement | 48 // does not map to a specific InfoBar type. Instead, you must implement |
| 49 // ConfirmInfoBarDelegate, or override with your own delegate for your own | 49 // ConfirmInfoBarDelegate, or override with your own delegate for your own |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 virtual InfoBarAutomationType GetInfoBarAutomationType() const; | 180 virtual InfoBarAutomationType GetInfoBarAutomationType() const; |
| 181 | 181 |
| 182 // Returns the resource ID of the icon to be shown for this InfoBar. If the | 182 // Returns the resource ID of the icon to be shown for this InfoBar. If the |
| 183 // value is equal to |kNoIconID|, GetIcon() will not show an icon by default. | 183 // value is equal to |kNoIconID|, GetIcon() will not show an icon by default. |
| 184 virtual int GetIconId() const; | 184 virtual int GetIconId() const; |
| 185 | 185 |
| 186 // Returns the vector icon identifier to be shown for this InfoBar. This will | 186 // Returns the vector icon identifier to be shown for this InfoBar. This will |
| 187 // take precedence over GetIconId() (although typically only one of the two | 187 // take precedence over GetIconId() (although typically only one of the two |
| 188 // should be defined for any given infobar). | 188 // should be defined for any given infobar). |
| 189 virtual gfx::VectorIconId GetVectorIconId() const; | 189 virtual const gfx::VectorIcon& GetVectorIcon() const; |
| 190 | 190 |
| 191 // Returns the icon to be shown for this InfoBar. If the returned Image is | 191 // Returns the icon to be shown for this InfoBar. If the returned Image is |
| 192 // empty, no icon is shown. | 192 // empty, no icon is shown. |
| 193 // | 193 // |
| 194 // Most subclasses should not override this; override GetIconId() instead | 194 // Most subclasses should not override this; override GetIconId() instead |
| 195 // unless the infobar needs to show an image from somewhere other than the | 195 // unless the infobar needs to show an image from somewhere other than the |
| 196 // resource bundle as its icon. | 196 // resource bundle as its icon. |
| 197 virtual gfx::Image GetIcon() const; | 197 virtual gfx::Image GetIcon() const; |
| 198 | 198 |
| 199 // Returns true if the supplied |delegate| is equal to this one. Equality is | 199 // Returns true if the supplied |delegate| is equal to this one. Equality is |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 | 248 |
| 249 // The ID of the active navigation entry at the time we became owned. | 249 // The ID of the active navigation entry at the time we became owned. |
| 250 int nav_entry_id_; | 250 int nav_entry_id_; |
| 251 | 251 |
| 252 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); | 252 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); |
| 253 }; | 253 }; |
| 254 | 254 |
| 255 } // namespace infobars | 255 } // namespace infobars |
| 256 | 256 |
| 257 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ | 257 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ |
| OLD | NEW |