Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5427)

Unified Diff: chrome/browser/infobars/infobar_tab_helper.cc

Issue 14320039: Make definition order match declaration order. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/infobars/infobar_tab_helper.cc
===================================================================
--- chrome/browser/infobars/infobar_tab_helper.cc (revision 194971)
+++ chrome/browser/infobars/infobar_tab_helper.cc (working copy)
@@ -135,50 +135,6 @@
return content::WebContentsObserver::web_contents();
}
-void InfoBarTabHelper::RemoveInfoBarInternal(InfoBarDelegate* delegate,
- bool animate) {
- if (!infobars_enabled_) {
- DCHECK(infobars_.empty());
- return;
- }
-
- InfoBars::iterator i(std::find(infobars_.begin(), infobars_.end(), delegate));
- DCHECK(i != infobars_.end());
-
- delegate->clear_owner();
- // Remove the delegate before notifying, so that if any observers call back to
- // AddInfoBar() or similar, we don't dupe-check against this delegate.
- infobars_.erase(i);
- // Remove ourselves as an observer if we are tracking no more InfoBars.
- if (infobars_.empty()) {
- registrar_.Remove(
- this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
- content::Source<NavigationController>(
- &web_contents()->GetController()));
- }
-
- InfoBarRemovedDetails removed_details(delegate, animate);
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
- content::Source<InfoBarService>(this),
- content::Details<InfoBarRemovedDetails>(&removed_details));
-}
-
-void InfoBarTabHelper::RemoveAllInfoBars(bool animate) {
- while (!infobars_.empty())
- RemoveInfoBarInternal(GetInfoBarDelegateAt(GetInfoBarCount() - 1), animate);
-}
-
-void InfoBarTabHelper::OnDidBlockDisplayingInsecureContent() {
- InsecureContentInfoBarDelegate::Create(
- this, InsecureContentInfoBarDelegate::DISPLAY);
-}
-
-void InfoBarTabHelper::OnDidBlockRunningInsecureContent() {
- InsecureContentInfoBarDelegate::Create(this,
- InsecureContentInfoBarDelegate::RUN);
-}
-
void InfoBarTabHelper::RenderViewGone(base::TerminationStatus status) {
RemoveAllInfoBars(true);
}
@@ -227,3 +183,46 @@
// returning from this function is the only safe thing to do.
return;
}
+void InfoBarTabHelper::RemoveInfoBarInternal(InfoBarDelegate* delegate,
+ bool animate) {
+ if (!infobars_enabled_) {
+ DCHECK(infobars_.empty());
+ return;
+ }
+
+ InfoBars::iterator i(std::find(infobars_.begin(), infobars_.end(), delegate));
+ DCHECK(i != infobars_.end());
+
+ delegate->clear_owner();
+ // Remove the delegate before notifying, so that if any observers call back to
+ // AddInfoBar() or similar, we don't dupe-check against this delegate.
+ infobars_.erase(i);
+ // Remove ourselves as an observer if we are tracking no more InfoBars.
+ if (infobars_.empty()) {
+ registrar_.Remove(
+ this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
+ content::Source<NavigationController>(
+ &web_contents()->GetController()));
+ }
+
+ InfoBarRemovedDetails removed_details(delegate, animate);
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED,
+ content::Source<InfoBarService>(this),
+ content::Details<InfoBarRemovedDetails>(&removed_details));
+}
+
+void InfoBarTabHelper::RemoveAllInfoBars(bool animate) {
+ while (!infobars_.empty())
+ RemoveInfoBarInternal(GetInfoBarDelegateAt(GetInfoBarCount() - 1), animate);
+}
+
+void InfoBarTabHelper::OnDidBlockDisplayingInsecureContent() {
+ InsecureContentInfoBarDelegate::Create(
+ this, InsecureContentInfoBarDelegate::DISPLAY);
+}
+
+void InfoBarTabHelper::OnDidBlockRunningInsecureContent() {
+ InsecureContentInfoBarDelegate::Create(this,
+ InsecureContentInfoBarDelegate::RUN);
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698