summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-09 18:37:30 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-09 18:37:30 +0000
commit4584f099ee0928d884f40e23d0864dd8fe72720b (patch)
tree0e6e7135796d562b2eb655d96761e6accc65484d /chrome/browser/ui/views
parent98e2fb9cc0e0a703a66ca68ad4d312cc1d79bd3f (diff)
downloadchromium_src-4584f099ee0928d884f40e23d0864dd8fe72720b.zip
chromium_src-4584f099ee0928d884f40e23d0864dd8fe72720b.tar.gz
chromium_src-4584f099ee0928d884f40e23d0864dd8fe72720b.tar.bz2
Don't reserve any space for infobar arrows when the container delegate doesn't want them drawn. This will hopefully fix a layout problem in Chrome Frame, which can't overlap the infobar container with anything above it the way Chrome can.
BUG=81749 TEST=Chrome frame infobars don't result in black gaps above them Review URL: http://codereview.chromium.org/6956005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84647 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views')
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc12
-rw-r--r--chrome/browser/ui/views/infobars/infobar_container.cc2
-rw-r--r--chrome/browser/ui/views/infobars/infobar_container.h2
3 files changed, 10 insertions, 6 deletions
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index f95a326..46c5917 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1718,11 +1718,13 @@ void BrowserView::InfoBarContainerStateChanged(bool is_animating) {
}
bool BrowserView::DrawInfoBarArrows(int* x) const {
- const LocationIconView* location_icon_view =
- toolbar_->location_bar()->location_icon_view();
- gfx::Point icon_center(location_icon_view->GetImageBounds().CenterPoint());
- ConvertPointToView(location_icon_view, this, &icon_center);
- *x = icon_center.x();
+ if (x) {
+ const LocationIconView* location_icon_view =
+ toolbar_->location_bar()->location_icon_view();
+ gfx::Point icon_center(location_icon_view->GetImageBounds().CenterPoint());
+ ConvertPointToView(location_icon_view, this, &icon_center);
+ *x = icon_center.x();
+ }
return true;
}
diff --git a/chrome/browser/ui/views/infobars/infobar_container.cc b/chrome/browser/ui/views/infobars/infobar_container.cc
index 2e87678..ea0955e 100644
--- a/chrome/browser/ui/views/infobars/infobar_container.cc
+++ b/chrome/browser/ui/views/infobars/infobar_container.cc
@@ -181,6 +181,8 @@ void InfoBarContainer::UpdateInfoBarArrowTargetHeights() {
}
int InfoBarContainer::ArrowTargetHeightForInfoBar(size_t infobar_index) const {
+ if (!delegate_->DrawInfoBarArrows(NULL))
+ return 0;
if (infobar_index == 0)
return top_arrow_target_height_;
const ui::SlideAnimation* first_infobar_animation =
diff --git a/chrome/browser/ui/views/infobars/infobar_container.h b/chrome/browser/ui/views/infobars/infobar_container.h
index 33bcdb6..293f811 100644
--- a/chrome/browser/ui/views/infobars/infobar_container.h
+++ b/chrome/browser/ui/views/infobars/infobar_container.h
@@ -36,7 +36,7 @@ class InfoBarContainer : public NotificationObserver {
virtual void InfoBarContainerStateChanged(bool is_animating) = 0;
// The delegate needs to tell us whether "unspoofable" arrows should be
- // drawn, and if so, at what |x| coordinate. |x| may not be NULL.
+ // drawn, and if so, at what |x| coordinate. |x| may be NULL.
virtual bool DrawInfoBarArrows(int* x) const = 0;
protected: