Index: chrome/browser/ui/views/infobars/extension_infobar.cc |
=================================================================== |
--- chrome/browser/ui/views/infobars/extension_infobar.cc (revision 96544) |
+++ chrome/browser/ui/views/infobars/extension_infobar.cc (working copy) |
@@ -42,19 +42,13 @@ |
ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)) { |
delegate->set_observer(this); |
- ExtensionView* extension_view = delegate->extension_host()->view(); |
- int height = extension_view->GetPreferredSize().height(); |
+ int height = delegate->height(); |
SetBarTargetHeight((height > 0) ? (height + kSeparatorLineHeight) : 0); |
- |
- // Get notified of resize events for the ExtensionView. |
- extension_view->SetContainer(this); |
} |
ExtensionInfoBar::~ExtensionInfoBar() { |
- if (GetDelegate()) { |
- GetDelegate()->extension_host()->view()->SetContainer(NULL); |
+ if (GetDelegate()) |
GetDelegate()->set_observer(NULL); |
- } |
} |
void ExtensionInfoBar::Layout() { |
@@ -109,35 +103,6 @@ |
return menu_->GetPreferredSize().width() + kMenuHorizontalMargin; |
} |
-void ExtensionInfoBar::OnExtensionMouseMove(ExtensionView* view) { |
-} |
- |
-void ExtensionInfoBar::OnExtensionMouseLeave(ExtensionView* view) { |
-} |
- |
-void ExtensionInfoBar::OnExtensionPreferredSizeChanged(ExtensionView* view) { |
- ExtensionInfoBarDelegate* delegate = GetDelegate(); |
- DCHECK_EQ(delegate->extension_host()->view(), view); |
- |
- // When the infobar is closed, it animates to 0 vertical height. We'll |
- // continue to get size changed notifications from the ExtensionView, but we |
- // need to ignore them otherwise we'll try to re-animate open (and leak the |
- // infobar view). |
- if (delegate->closing()) |
- return; |
- |
- view->SetVisible(true); |
- |
- if (height() == 0) |
- animation()->Reset(0.0); |
- |
- // Clamp height to a min and a max size of between 1 and 2 InfoBars. |
- SetBarTargetHeight(std::min(2 * kDefaultBarTargetHeight, |
- std::max(kDefaultBarTargetHeight, view->GetPreferredSize().height()))); |
- |
- animation()->Show(); |
-} |
- |
void ExtensionInfoBar::OnImageLoaded(SkBitmap* image, |
const ExtensionResource& resource, |
int index) { |
@@ -169,7 +134,6 @@ |
} |
void ExtensionInfoBar::OnDelegateDeleted() { |
- GetDelegate()->extension_host()->view()->SetContainer(NULL); |
delegate_ = NULL; |
} |