Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: components/infobars/core/infobar_delegate.h

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverting Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « components/infobars/core/infobar_container.cc ('k') | components/infobars/core/simple_alert_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698