summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/info_bar_view.cc
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-14 16:42:25 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-14 16:42:25 +0000
commit807bfceada33743cad3308af48c538d7d7515495 (patch)
tree19953eac8d00695cfbb8c00137d8eb192e0aedc7 /chrome/browser/views/info_bar_view.cc
parent7b7965f2391594e6a3944ffee8fcdaaf18683fc3 (diff)
downloadchromium_src-807bfceada33743cad3308af48c538d7d7515495.zip
chromium_src-807bfceada33743cad3308af48c538d7d7515495.tar.gz
chromium_src-807bfceada33743cad3308af48c538d7d7515495.tar.bz2
Move more view stuff out of WebContents. This moves context menus and info
bars. I removed the associated functions on TabContents, and have callers call directly through to the view when the care about mucking with the info bar (which is busted, IMO). Review URL: http://codereview.chromium.org/7245 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3346 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/info_bar_view.cc')
-rw-r--r--chrome/browser/views/info_bar_view.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/views/info_bar_view.cc b/chrome/browser/views/info_bar_view.cc
index 00a704f9..17d4a2a 100644
--- a/chrome/browser/views/info_bar_view.cc
+++ b/chrome/browser/views/info_bar_view.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/navigation_entry.h"
#include "chrome/browser/tab_contents_delegate.h"
#include "chrome/browser/web_contents.h"
+#include "chrome/browser/web_contents_view.h"
#include "chrome/common/gfx/chrome_canvas.h"
#include "chrome/common/l10n_util.h"
#include "chrome/common/resource_bundle.h"
@@ -128,10 +129,13 @@ void InfoBarView::ViewHierarchyChanged(bool is_add, View *parent,
expire_map_[child] = GetActiveID();
}
- if (web_contents_->IsInfoBarVisible()) {
+ // TODO(brettw) clean up the ownership of this info bar. It should be owned
+ // by the web contents view instead. In the meantime, we assume we're owned
+ // by a WebContents.
+ if (web_contents_->AsWebContents()->view()->IsInfoBarVisible()) {
web_contents_->ToolbarSizeChanged(false);
} else {
- web_contents_->SetInfoBarVisible(true);
+ web_contents_->view()->SetInfoBarVisible(true);
}
}
}
@@ -231,7 +235,7 @@ void InfoBarView::Observe(NotificationType type,
if (GetChildViewCount() == 0) {
// All our views have been removed, no need to stay visible.
- web_contents_->SetInfoBarVisible(false);
+ web_contents_->view()->SetInfoBarVisible(false);
} else if (web_contents_) {
// This triggers a layout.
web_contents_->ToolbarSizeChanged(false);