diff options
Diffstat (limited to 'chrome/browser/extensions/theme_preview_infobar_delegate.cc')
-rw-r--r-- | chrome/browser/extensions/theme_preview_infobar_delegate.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/extensions/theme_preview_infobar_delegate.cc b/chrome/browser/extensions/theme_preview_infobar_delegate.cc index b55df72..75c1ce8 100644 --- a/chrome/browser/extensions/theme_preview_infobar_delegate.cc +++ b/chrome/browser/extensions/theme_preview_infobar_delegate.cc @@ -16,6 +16,19 @@ ThemePreviewInfobarDelegate::ThemePreviewInfobarDelegate( profile_(tab_contents->profile()), name_(name) { } +bool ThemePreviewInfobarDelegate::EqualsDelegate(InfoBarDelegate* delegate) + const { + // If another infobar of this type is showing, this will prevent us adding + // a new one, we only care if they're the same type, as pressing undo always + // has the same result each time. This does mean that the text continues + // to refer to the old theme, but this is good enough for beta. + // http://crbug.com/17932 + if (delegate->AsThemePreviewInfobarDelegate()) + return true; + + return false; +} + void ThemePreviewInfobarDelegate::InfoBarClosed() { delete this; } @@ -31,6 +44,11 @@ SkBitmap* ThemePreviewInfobarDelegate::GetIcon() const { return NULL; } +ThemePreviewInfobarDelegate* + ThemePreviewInfobarDelegate::AsThemePreviewInfobarDelegate() { + return this; +} + int ThemePreviewInfobarDelegate::GetButtons() const { return BUTTON_CANCEL; } |