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

Unified 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: Missed a spot. 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 side-by-side diff with in-line comments
Download patch
Index: components/infobars/core/infobar_delegate.h
diff --git a/components/infobars/core/infobar_delegate.h b/components/infobars/core/infobar_delegate.h
index 7508de872cb569ebab1153ac967846559b5e3cfe..02d8fb7b3ad227a6dfdc84b3904e6d23c723cecf 100644
--- a/components/infobars/core/infobar_delegate.h
+++ b/components/infobars/core/infobar_delegate.h
@@ -60,6 +60,65 @@ class InfoBarDelegate {
UNKNOWN_INFOBAR,
};
+ // Unique identifier for every InfoBarDelegate subclass.
+ // KEEP IN SYNC WITH THE InfoBarIdentifier ENUM IN histograms.xml.
+ // NEW VALUES MUST BE APPENDED AND AVOID CHANGING ANY PRE-EXISTING VALUES.
+ enum InfoBarIdentifier {
+ INVALID_ID,
Peter Kasting 2015/12/30 01:52:57 I'm inclined to remove "_ID" from every item as I'
gone 2015/12/30 07:29:03 Done.
+ TEST_INFOBAR_ID,
Peter Kasting 2015/12/30 01:52:57 What do you think about putting an explicit "= n"
gone 2015/12/30 07:29:03 Sounds good. Alleviates a few of my concerns abou
+ APP_BANNER_INFOBAR_DELEGATE_ANDROID_ID,
+ APP_BANNER_INFOBAR_DELEGATE_DESKTOP_ID,
+ ANDROID_DOWNLOAD_MANAGER_OVERWRITE_INFOBAR_DELEGATE_ID,
+ CHROME_DOWNLOAD_MANAGER_OVERWRITE_INFOBAR_DELEGATE_ID,
+ DOWNLOAD_REQUEST_INFOBAR_DELEGATE_ANDROID_ID,
+ FULLSCREEN_INFOBAR_DELEGATE_ID,
+ HUNG_PLUGIN_INFOBAR_DELEGATE_ID,
+ HUNG_RENDERER_INFOBAR_DELEGATE_ID,
+ MEDIA_STREAM_INFOBAR_DELEGATE_ANDROID_ID,
+ MEDIA_THROTTLE_INFOBAR_DELEGATE_ID,
+ REQUEST_QUOTA_INFOBAR_DELEGATE_ID,
+ DEV_TOOLS_CONFIRM_INFOBAR_DELEGATE_ID,
+ EXTENSION_DEV_TOOLS_INFOBAR_DELEGATE_ID,
+ INCOGNITO_CONNECTABILITY_INFOBAR_DELEGATE_ID,
+ THEME_INSTALLED_INFOBAR_DELEGATE_ID,
+ GEOLOCATION_INFOBAR_DELEGATE_ANDROID_ID,
+ THREE_D_API_INFOBAR_DELEGATE_ID,
+ INSECURE_CONTENT_INFOBAR_DELEGATE_ID,
+ MIDI_PERMISSION_INFOBAR_DELEGATE_ANDROID_ID,
+ PROTECTED_MEDIA_IDENTIFIER_INFOBAR_DELEGATE_ANDROID_ID,
+ NACL_INFOBAR_DELEGATE_ID,
+ DATA_REDUCTION_PROXY_INFOBAR_DELEGATE_ANDROID_ID,
+ NOTIFICATION_PERMISSION_INFOBAR_DELEGATE_ID,
+ AUTO_SIGNIN_FIRST_RUN_INFOBAR_DELEGATE_ID,
+ GENERATED_PASSWORD_SAVED_INFOBAR_DELEGATE_ANDROID_ID,
+ SAVE_PASSWORD_INFOBAR_DELEGATE_ID,
+ PEPPER_BROKER_INFOBAR_DELEGATE_ID,
+ PERMISSION_UPDATE_INFOBAR_DELEGATE_ID,
+ DURABLE_STORAGE_PERMISSION_INFOBAR_DELEGATE_ANDROID_ID,
+ NPAPI_REMOVAL_INFOBAR_DELEGATE_ID,
+ OUTDATED_PLUGIN_INFOBAR_DELEGATE_ID,
+ PLUGIN_METRO_MODE_INFOBAR_DELEGATE_ID,
+ RELOAD_PLUGIN_INFOBAR_DELEGATE_ID,
+ PLUGIN_OBSERVER_ID,
+ SSL_ADD_CERTIFICATE_ID,
+ SSL_ADD_CERTIFICATE_INFOBAR_DELEGATE_ID,
+ POPUP_BLOCKED_INFOBAR_DELEGATE_ID,
+ CHROME_SELECT_FILE_POLICY_ID,
+ KEYSTONE_PROMOTION_INFOBAR_DELEGATE_ID,
+ COLLECTED_COOKIES_INFOBAR_DELEGATE_ID,
+ INSTALLATION_ERROR_INFOBAR_DELEGATE_ID,
+ ALTERNATE_NAV_INFOBAR_DELEGATE_ID,
+ BAD_FLAGS_PROMPT_ID,
+ DEFAULT_BROWSER_INFOBAR_DELEGATE_ID,
+ GOOGLE_API_KEYS_INFOBAR_DELEGATE_ID,
+ OBSOLETE_SYSTEM_INFOBAR_DELEGATE_ID,
+ SESSION_CRASHED_INFOBAR_DELEGATE_ID,
+ WEBSITE_SETTINGS_INFOBAR_DELEGATE_ID,
+ AUTOFILL_CC_INFOBAR_DELEGATE_ID,
+ TRANSLATE_INFOBAR_DELEGATE_ID,
+ IOS_CHROME_SAVE_PASSWORD_INFOBAR_DELEGATE_ID
+ };
+
// Describes navigation events, used to decide whether infobars should be
// dismissed.
struct NavigationDetails {
@@ -84,6 +143,11 @@ class InfoBarDelegate {
// as background color) of the infobar.
virtual Type GetInfoBarType() const;
+ // Returns a unique value identifying the infobar.
+ // New implementers must append a new value to the InfoBarIdentifier enum here
+ // and in histograms.xml.
+ virtual InfoBarIdentifier GetIdentifier() const = 0;
+
virtual InfoBarAutomationType GetInfoBarAutomationType() const;
// Returns the resource ID of the icon to be shown for this InfoBar. If the

Powered by Google App Engine
This is Rietveld 408576698