summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-01 18:56:21 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-01 18:56:21 +0000
commit7e2041201c0de2336b80f5afb9e7bebeda6be68e (patch)
treebfda35d9f7b84ec7347baa35b18551bfae967967 /chrome/browser/tab_contents
parentfed17d435c43ab7ef492664196ec4535b3a48af5 (diff)
downloadchromium_src-7e2041201c0de2336b80f5afb9e7bebeda6be68e.zip
chromium_src-7e2041201c0de2336b80f5afb9e7bebeda6be68e.tar.gz
chromium_src-7e2041201c0de2336b80f5afb9e7bebeda6be68e.tar.bz2
Move infobar handling to a tab helper, part 1.
Revert revert of r99187. This reverts r99198. BUG=94741 TEST=no visible change Review URL: http://codereview.chromium.org/7810002 TBR=avi@chromium.org Review URL: http://codereview.chromium.org/7827017 Review URL: http://codereview.chromium.org/7826014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99222 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/infobar.cc3
-rw-r--r--chrome/browser/tab_contents/infobar_container.cc8
-rw-r--r--chrome/browser/tab_contents/infobar_delegate.cc3
-rw-r--r--chrome/browser/tab_contents/tab_contents_ssl_helper.cc6
4 files changed, 14 insertions, 6 deletions
diff --git a/chrome/browser/tab_contents/infobar.cc b/chrome/browser/tab_contents/infobar.cc
index d8dacb2..b20bd8d 100644
--- a/chrome/browser/tab_contents/infobar.cc
+++ b/chrome/browser/tab_contents/infobar.cc
@@ -8,6 +8,7 @@
#include "build/build_config.h"
#include "base/logging.h"
+#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/tab_contents/infobar_container.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "ui/base/animation/slide_animation.h"
@@ -104,7 +105,7 @@ void InfoBar::RemoveSelf() {
// |owner_| can be NULL here, e.g. because the user clicks the close button
// when the infobar is already closing.
if (delegate_ && owner_)
- owner_->RemoveInfoBar(delegate_);
+ owner_->infobar_tab_helper()->RemoveInfoBar(delegate_);
}
void InfoBar::SetBarTargetHeight(int height) {
diff --git a/chrome/browser/tab_contents/infobar_container.cc b/chrome/browser/tab_contents/infobar_container.cc
index cfd66e6..e01d38a 100644
--- a/chrome/browser/tab_contents/infobar_container.cc
+++ b/chrome/browser/tab_contents/infobar_container.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/tab_contents/infobar_container.h"
+#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/tab_contents/infobar.h"
#include "chrome/browser/tab_contents/infobar_delegate.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
@@ -51,11 +52,14 @@ void InfoBarContainer::ChangeTabContents(TabContentsWrapper* contents) {
registrar_.Add(this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REPLACED,
tc_source);
- for (size_t i = 0; i < tab_contents_->infobar_count(); ++i) {
+ for (size_t i = 0;
+ i < tab_contents_->infobar_tab_helper()->infobar_count();
+ ++i) {
// As when we removed the infobars above, we prevent callbacks to
// OnInfoBarAnimated() for each infobar.
AddInfoBar(
- tab_contents_->GetInfoBarDelegateAt(i)->CreateInfoBar(tab_contents_),
+ tab_contents_->infobar_tab_helper()->GetInfoBarDelegateAt(i)->
+ CreateInfoBar(tab_contents_),
i, false, NO_CALLBACK);
}
}
diff --git a/chrome/browser/tab_contents/infobar_delegate.cc b/chrome/browser/tab_contents/infobar_delegate.cc
index f6d88a8..e2b9477 100644
--- a/chrome/browser/tab_contents/infobar_delegate.cc
+++ b/chrome/browser/tab_contents/infobar_delegate.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "build/build_config.h"
+#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "content/browser/tab_contents/navigation_details.h"
#include "content/browser/tab_contents/navigation_entry.h"
@@ -96,6 +97,6 @@ bool InfoBarDelegate::ShouldExpireInternal(
void InfoBarDelegate::RemoveSelf() {
if (owner_) {
TabContentsWrapper::GetCurrentWrapperForContents(owner_)->
- RemoveInfoBar(this); // Clears |owner_|.
+ infobar_tab_helper()->RemoveInfoBar(this); // Clears |owner_|.
}
}
diff --git a/chrome/browser/tab_contents/tab_contents_ssl_helper.cc b/chrome/browser/tab_contents/tab_contents_ssl_helper.cc
index 3ae8a2e..a15bfa2 100644
--- a/chrome/browser/tab_contents/tab_contents_ssl_helper.cc
+++ b/chrome/browser/tab_contents/tab_contents_ssl_helper.cc
@@ -12,6 +12,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/certificate_viewer.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
+#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ssl/ssl_add_cert_handler.h"
#include "chrome/browser/ssl_client_certificate_selector.h"
@@ -150,9 +151,10 @@ TabContentsSSLHelper::SSLAddCertData::~SSLAddCertData() {
void TabContentsSSLHelper::SSLAddCertData::ShowInfoBar(
InfoBarDelegate* delegate) {
if (infobar_delegate_)
- tab_contents_->ReplaceInfoBar(infobar_delegate_, delegate);
+ tab_contents_->infobar_tab_helper()->ReplaceInfoBar(infobar_delegate_,
+ delegate);
else
- tab_contents_->AddInfoBar(delegate);
+ tab_contents_->infobar_tab_helper()->AddInfoBar(delegate);
infobar_delegate_ = delegate;
}