diff options
author | dyu@chromium.org <dyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-07 02:13:43 +0000 |
---|---|---|
committer | dyu@chromium.org <dyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-07 02:13:43 +0000 |
commit | 1bfe0abd272f0879476310bcaa61c7a7e34d4c66 (patch) | |
tree | 61fe89093f06b3ca06697003fbe39302a1b32650 /chrome/browser/infobars | |
parent | b75b742a7c71dcc7338f468bb7e367a7892da483 (diff) | |
download | chromium_src-1bfe0abd272f0879476310bcaa61c7a7e34d4c66.zip chromium_src-1bfe0abd272f0879476310bcaa61c7a7e34d4c66.tar.gz chromium_src-1bfe0abd272f0879476310bcaa61c7a7e34d4c66.tar.bz2 |
Added type enum to the base class with a getter virtual method. This prevents from
having to keep adding methods to the base InfoBarDelegate class for each new
infobar type.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/10008063
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131235 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/infobars')
-rw-r--r-- | chrome/browser/infobars/infobar_delegate.cc | 14 | ||||
-rw-r--r-- | chrome/browser/infobars/infobar_delegate.h | 13 |
2 files changed, 15 insertions, 12 deletions
diff --git a/chrome/browser/infobars/infobar_delegate.cc b/chrome/browser/infobars/infobar_delegate.cc index 58f4501..fc46d3f 100644 --- a/chrome/browser/infobars/infobar_delegate.cc +++ b/chrome/browser/infobars/infobar_delegate.cc @@ -19,6 +19,11 @@ using content::NavigationEntry; InfoBarDelegate::~InfoBarDelegate() { } +InfoBarDelegate::InfoBarAutomationType + InfoBarDelegate::GetInfoBarAutomationType() const { + return UNKNOWN_INFOBAR; +} + bool InfoBarDelegate::EqualsDelegate(InfoBarDelegate* delegate) const { return false; } @@ -67,15 +72,6 @@ MediaStreamInfoBarDelegate* InfoBarDelegate::AsMediaStreamInfobarDelegate() { return NULL; } -OneClickLoginInfoBarDelegate* - InfoBarDelegate::AsOneClickLoginInfoBarDelegate() { - return NULL; -} - -SavePasswordInfoBarDelegate* InfoBarDelegate::AsSavePasswordInfoBarDelegate() { - return NULL; -} - RegisterProtocolHandlerInfoBarDelegate* InfoBarDelegate::AsRegisterProtocolHandlerInfoBarDelegate() { return NULL; diff --git a/chrome/browser/infobars/infobar_delegate.h b/chrome/browser/infobars/infobar_delegate.h index e109e4b..9011491 100644 --- a/chrome/browser/infobars/infobar_delegate.h +++ b/chrome/browser/infobars/infobar_delegate.h @@ -17,7 +17,6 @@ class InfoBarTabHelper; class InsecureContentInfoBarDelegate; class LinkInfoBarDelegate; class MediaStreamInfoBarDelegate; -class OneClickLoginInfoBarDelegate; class PluginInstallerInfoBarDelegate; class RegisterProtocolHandlerInfoBarDelegate; class SavePasswordInfoBarDelegate; @@ -45,8 +44,18 @@ class InfoBarDelegate { PAGE_ACTION_TYPE, }; + enum InfoBarAutomationType { + CONFIRM_INFOBAR, + ONE_CLICK_LOGIN_INFOBAR, + PASSWORD_INFOBAR, + RPH_INFOBAR, + UNKNOWN_INFOBAR, + }; + virtual ~InfoBarDelegate(); + virtual InfoBarAutomationType GetInfoBarAutomationType() const; + // Called to create the InfoBar. Implementation of this method is // platform-specific. virtual InfoBar* CreateInfoBar(InfoBarTabHelper* owner) = 0; @@ -92,10 +101,8 @@ class InfoBarDelegate { virtual InsecureContentInfoBarDelegate* AsInsecureContentInfoBarDelegate(); virtual LinkInfoBarDelegate* AsLinkInfoBarDelegate(); virtual MediaStreamInfoBarDelegate* AsMediaStreamInfobarDelegate(); - virtual OneClickLoginInfoBarDelegate* AsOneClickLoginInfoBarDelegate(); virtual RegisterProtocolHandlerInfoBarDelegate* AsRegisterProtocolHandlerInfoBarDelegate(); - virtual SavePasswordInfoBarDelegate* AsSavePasswordInfoBarDelegate(); virtual ThemeInstalledInfoBarDelegate* AsThemePreviewInfobarDelegate(); virtual TranslateInfoBarDelegate* AsTranslateInfoBarDelegate(); |