diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 19:13:44 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 19:13:44 +0000 |
commit | ab861b4d129b7dfc67ab7b1dc8ccfbacff3dde17 (patch) | |
tree | b0b97b6a1427ff1b8c853c11dcfadf63f3b90bb4 /chrome/browser/views/infobars/infobar_container.cc | |
parent | ac3fa8e2ef53e83b113d726209525f4af4aa46f1 (diff) | |
download | chromium_src-ab861b4d129b7dfc67ab7b1dc8ccfbacff3dde17.zip chromium_src-ab861b4d129b7dfc67ab7b1dc8ccfbacff3dde17.tar.gz chromium_src-ab861b4d129b7dfc67ab7b1dc8ccfbacff3dde17.tar.bz2 |
This CL adds support for displaying Chrome InfoBars in pages rendered via ChromeFrame. To achieve this
the ExternalTabContainer now creates a view which comprises of the InfoBarContainer and the TabContentsContainer
view. It uses the GridLayout manager to layout this view.
The InfoBarContainer no longer depends on the BrowserView. It now passes notifications to the InfoBarContainerDelegate
interface which is implemented by the BrowserView and the ExternalTabContainer.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=24051
Bug=24051
Review URL: http://codereview.chromium.org/573022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38228 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/infobars/infobar_container.cc')
-rw-r--r-- | chrome/browser/views/infobars/infobar_container.cc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/chrome/browser/views/infobars/infobar_container.cc b/chrome/browser/views/infobars/infobar_container.cc index 3e91d36..cea200a 100644 --- a/chrome/browser/views/infobars/infobar_container.cc +++ b/chrome/browser/views/infobars/infobar_container.cc @@ -7,23 +7,22 @@ #include "chrome/browser/tab_contents/infobar_delegate.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/view_ids.h" -#include "chrome/browser/views/frame/browser_view.h" #include "chrome/browser/views/infobars/infobars.h" #include "chrome/common/notification_service.h" // InfoBarContainer, public: --------------------------------------------------- -InfoBarContainer::InfoBarContainer(BrowserView* browser_view) - : browser_view_(browser_view), +InfoBarContainer::InfoBarContainer(Delegate* delegate) + : delegate_(delegate), tab_contents_(NULL) { SetID(VIEW_ID_INFO_BAR_CONTAINER); } InfoBarContainer::~InfoBarContainer() { // We NULL this pointer before resetting the TabContents to prevent view - // hierarchy modifications from attempting to adjust the BrowserView, which is - // in the process of shutting down. - browser_view_ = NULL; + // hierarchy modifications from attempting to resize the delegate which + // could be in the process of shutting down. + delegate_ = NULL; ChangeTabContents(NULL); } @@ -46,8 +45,8 @@ void InfoBarContainer::ChangeTabContents(TabContents* contents) { } void InfoBarContainer::InfoBarAnimated(bool completed) { - if (browser_view_) - browser_view_->SelectedTabToolbarSizeChanged(!completed); + if (delegate_) + delegate_->InfoBarSizeChanged(!completed); } void InfoBarContainer::RemoveDelegate(InfoBarDelegate* delegate) { @@ -58,7 +57,7 @@ void InfoBarContainer::RemoveDelegate(InfoBarDelegate* delegate) { gfx::Size InfoBarContainer::GetPreferredSize() { // We do not have a preferred width (we will expand to fit the available width - // of the BrowserView). Our preferred height is the sum of the preferred + // of the delegate). Our preferred height is the sum of the preferred // heights of the InfoBars contained within us. int height = 0; for (int i = 0; i < GetChildViewCount(); ++i) @@ -100,10 +99,12 @@ void InfoBarContainer::SetAccessibleName(const std::wstring& name) { void InfoBarContainer::ViewHierarchyChanged(bool is_add, views::View* parent, views::View* child) { - if (parent == this && child->GetParent() == this && browser_view_) { - // An InfoBar child was added or removed. Tell the BrowserView it needs to - // re-layout since our preferred size will have changed. - browser_view_->SelectedTabToolbarSizeChanged(false); + if (parent == this && child->GetParent() == this) { + if (delegate_) { + // An InfoBar child was added or removed. Tell the delegate it needs to + // re-layout since our preferred size will have changed. + delegate_->InfoBarSizeChanged(false); + } } } |