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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 static const int kNoIconID; | 76 static const int kNoIconID; |
77 | 77 |
78 // Called when the InfoBar that owns this delegate is being destroyed. At | 78 // Called when the InfoBar that owns this delegate is being destroyed. At |
79 // this point nothing is visible onscreen. | 79 // this point nothing is visible onscreen. |
80 virtual ~InfoBarDelegate(); | 80 virtual ~InfoBarDelegate(); |
81 | 81 |
82 // Returns the type of the infobar. The type determines the appearance (such | 82 // Returns the type of the infobar. The type determines the appearance (such |
83 // as background color) of the infobar. | 83 // as background color) of the infobar. |
84 virtual Type GetInfoBarType() const; | 84 virtual Type GetInfoBarType() const; |
85 | 85 |
86 // Returns a unique string identifying the infobar. | |
87 // Implementers must update the InfoBarType enum in histograms.xml, with the | |
Peter Kasting
2015/12/16 21:02:46
Nit: No comma
gone
2015/12/16 22:53:11
Done.
| |
88 // string provided by this function as the key and | |
89 // base::HashMetricName(string) as its value. | |
90 virtual std::string GetIdentifier() const = 0; | |
91 | |
86 virtual InfoBarAutomationType GetInfoBarAutomationType() const; | 92 virtual InfoBarAutomationType GetInfoBarAutomationType() const; |
87 | 93 |
88 // Returns the resource ID of the icon to be shown for this InfoBar. If the | 94 // Returns the resource ID of the icon to be shown for this InfoBar. If the |
89 // value is equal to |kNoIconID|, GetIcon() will not show an icon by default. | 95 // value is equal to |kNoIconID|, GetIcon() will not show an icon by default. |
90 virtual int GetIconId() const; | 96 virtual int GetIconId() const; |
91 | 97 |
92 // Returns the vector icon identifier to be shown for this InfoBar. This will | 98 // Returns the vector icon identifier to be shown for this InfoBar. This will |
93 // take precedence over GetIconId() (although typically only one of the two | 99 // take precedence over GetIconId() (although typically only one of the two |
94 // should be defined for any given infobar). | 100 // should be defined for any given infobar). |
95 virtual gfx::VectorIconId GetVectorIconId() const; | 101 virtual gfx::VectorIconId GetVectorIconId() const; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
153 | 159 |
154 // The ID of the active navigation entry at the time we became owned. | 160 // The ID of the active navigation entry at the time we became owned. |
155 int nav_entry_id_; | 161 int nav_entry_id_; |
156 | 162 |
157 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); | 163 DISALLOW_COPY_AND_ASSIGN(InfoBarDelegate); |
158 }; | 164 }; |
159 | 165 |
160 } // namespace infobars | 166 } // namespace infobars |
161 | 167 |
162 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ | 168 #endif // COMPONENTS_INFOBARS_CORE_INFOBAR_DELEGATE_H_ |
OLD | NEW |