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

Unified Diff: chrome/browser/managed_mode/managed_mode_navigation_observer.cc

Issue 190063006: Infobar Componentization Proof of Concept (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fixes Created 6 years, 9 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
Index: chrome/browser/managed_mode/managed_mode_navigation_observer.cc
diff --git a/chrome/browser/managed_mode/managed_mode_navigation_observer.cc b/chrome/browser/managed_mode/managed_mode_navigation_observer.cc
index bd06cafedd2b045038b760ddc2abf159ce568eb8..b8784c5b2c08599927dc155004a43906cbb3494c 100644
--- a/chrome/browser/managed_mode/managed_mode_navigation_observer.cc
+++ b/chrome/browser/managed_mode/managed_mode_navigation_observer.cc
@@ -11,7 +11,7 @@
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/history/history_types.h"
-#include "chrome/browser/infobars/confirm_infobar_delegate.h"
+#include "chrome/browser/infobars/content_confirm_infobar_delegate.h"
#include "chrome/browser/infobars/infobar.h"
#include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/managed_mode/managed_mode_interstitial.h"
@@ -79,19 +79,19 @@ void GoBackToSafety(content::WebContents* web_contents) {
// ManagedModeWarningInfoBarDelegate ------------------------------------------
-class ManagedModeWarningInfoBarDelegate : public ConfirmInfoBarDelegate {
+class ManagedModeWarningInfoBarDelegate : public ContentConfirmInfoBarDelegate {
public:
// Creates a managed mode warning infobar and delegate and adds the infobar to
// |infobar_service|. Returns the infobar if it was successfully added.
static InfoBar* Create(InfoBarService* infobar_service);
private:
- ManagedModeWarningInfoBarDelegate();
+ explicit ManagedModeWarningInfoBarDelegate(
+ content::WebContents* web_contents);
virtual ~ManagedModeWarningInfoBarDelegate();
// ConfirmInfoBarDelegate:
- virtual bool ShouldExpire(
- const content::LoadCommittedDetails& details) const OVERRIDE;
+ virtual bool ShouldExpire(const NavigationDetails& details) const OVERRIDE;
virtual void InfoBarDismissed() OVERRIDE;
virtual base::string16 GetMessageText() const OVERRIDE;
virtual int GetButtons() const OVERRIDE;
@@ -105,19 +105,19 @@ class ManagedModeWarningInfoBarDelegate : public ConfirmInfoBarDelegate {
InfoBar* ManagedModeWarningInfoBarDelegate::Create(
InfoBarService* infobar_service) {
return infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar(
- scoped_ptr<ConfirmInfoBarDelegate>(
- new ManagedModeWarningInfoBarDelegate())));
+ scoped_ptr<ConfirmInfoBarDelegate>(new ManagedModeWarningInfoBarDelegate(
+ infobar_service->web_contents()))));
}
-ManagedModeWarningInfoBarDelegate::ManagedModeWarningInfoBarDelegate()
- : ConfirmInfoBarDelegate() {
-}
+ManagedModeWarningInfoBarDelegate::ManagedModeWarningInfoBarDelegate(
+ content::WebContents* web_contents)
+ : ContentConfirmInfoBarDelegate(web_contents) {}
ManagedModeWarningInfoBarDelegate::~ManagedModeWarningInfoBarDelegate() {
}
bool ManagedModeWarningInfoBarDelegate::ShouldExpire(
- const content::LoadCommittedDetails& details) const {
+ const NavigationDetails& details) const {
// ManagedModeNavigationObserver removes us below.
return false;
}
@@ -188,7 +188,9 @@ void ManagedModeNavigationObserver::ProvisionalChangeToMainFrameUrl(
return;
// If we shouldn't have a warn infobar remove it here.
- InfoBarService::FromWebContents(web_contents())->RemoveInfoBar(warn_infobar_);
+ InfoBarService::FromWebContents(web_contents())
+ ->infobar_manager()
+ .RemoveInfoBar(warn_infobar_);
warn_infobar_ = NULL;
}

Powered by Google App Engine
This is Rietveld 408576698