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

Unified Diff: chrome/browser/ui/views/infobars/extension_infobar.cc

Issue 7635019: Set Extension Infobars to have a fixed height determined by the developer (clamped to sane min an... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 months 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: 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;
}

Powered by Google App Engine
This is Rietveld 408576698