Index: chrome/browser/infobars/infobar_tab_helper.cc |
diff --git a/chrome/browser/infobars/infobar_tab_helper.cc b/chrome/browser/infobars/infobar_tab_helper.cc |
index 405661f8907773a159715f4f4c47bfe10583b793..275df5789f4a7bbc5de008b41f2188d8c00ceb90 100644 |
--- a/chrome/browser/infobars/infobar_tab_helper.cc |
+++ b/chrome/browser/infobars/infobar_tab_helper.cc |
@@ -7,6 +7,7 @@ |
#include "chrome/browser/api/infobars/infobar_delegate.h" |
#include "chrome/browser/infobars/infobar.h" |
#include "chrome/browser/infobars/insecure_content_infobar_delegate.h" |
+#include "chrome/browser/ui/tab_contents/tab_contents.h" |
#include "chrome/common/chrome_notification_types.h" |
#include "chrome/common/render_messages.h" |
#include "content/public/browser/navigation_controller.h" |
@@ -16,6 +17,10 @@ |
using content::NavigationController; |
using content::WebContents; |
+InfoBarTabService* InfoBarTabService::ForTab(TabContents* tab) { |
+ return tab->infobar_tab_helper(); |
+} |
+ |
InfoBarTabHelper::InfoBarTabHelper(WebContents* web_contents) |
: content::WebContentsObserver(web_contents), |
infobars_enabled_(true) { |
@@ -94,10 +99,18 @@ bool InfoBarTabHelper::ReplaceInfoBar(InfoBarDelegate* old_delegate, |
return true; |
} |
+size_t InfoBarTabHelper::GetInfoBarCount() const { |
+ return infobars_.size(); |
+} |
+ |
InfoBarDelegate* InfoBarTabHelper::GetInfoBarDelegateAt(size_t index) { |
return infobars_[index]; |
} |
+content::WebContents* InfoBarTabHelper::GetWebContents() { |
+ return content::WebContentsObserver::web_contents(); |
+} |
+ |
void InfoBarTabHelper::RemoveInfoBarInternal(InfoBarDelegate* delegate, |
bool animate) { |
if (!infobars_enabled_) { |
@@ -129,7 +142,7 @@ void InfoBarTabHelper::RemoveInfoBarInternal(InfoBarDelegate* delegate, |
void InfoBarTabHelper::RemoveAllInfoBars(bool animate) { |
while (!infobars_.empty()) |
- RemoveInfoBarInternal(GetInfoBarDelegateAt(infobar_count() - 1), animate); |
+ RemoveInfoBarInternal(GetInfoBarDelegateAt(GetInfoBarCount() - 1), animate); |
} |
void InfoBarTabHelper::OnDidBlockDisplayingInsecureContent() { |