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/tab_contents | |
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/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/confirm_infobar_delegate.cc | 7 | ||||
-rw-r--r-- | chrome/browser/tab_contents/confirm_infobar_delegate.h | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/chrome/browser/tab_contents/confirm_infobar_delegate.cc b/chrome/browser/tab_contents/confirm_infobar_delegate.cc index d3a252d..8418c061 100644 --- a/chrome/browser/tab_contents/confirm_infobar_delegate.cc +++ b/chrome/browser/tab_contents/confirm_infobar_delegate.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,6 +8,11 @@ #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" +InfoBarDelegate::InfoBarAutomationType + ConfirmInfoBarDelegate::GetInfoBarAutomationType() const { + return CONFIRM_INFOBAR; +} + int ConfirmInfoBarDelegate::GetButtons() const { return BUTTON_OK | BUTTON_CANCEL; } diff --git a/chrome/browser/tab_contents/confirm_infobar_delegate.h b/chrome/browser/tab_contents/confirm_infobar_delegate.h index 593fe3d..8d7e703 100644 --- a/chrome/browser/tab_contents/confirm_infobar_delegate.h +++ b/chrome/browser/tab_contents/confirm_infobar_delegate.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -21,6 +21,9 @@ class ConfirmInfoBarDelegate : public InfoBarDelegate { BUTTON_CANCEL = 1 << 1, }; + // Returns the InfoBar type to be displayed for the InfoBar. + virtual InfoBarAutomationType GetInfoBarAutomationType() const OVERRIDE; + // Returns the message string to be displayed for the InfoBar. virtual string16 GetMessageText() const = 0; |