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

Unified Diff: chrome/browser/infobars/infobar_service.h

Issue 228293004: InfoBarService inherits from InfoBarManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor changes Created 6 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
Index: chrome/browser/infobars/infobar_service.h
diff --git a/chrome/browser/infobars/infobar_service.h b/chrome/browser/infobars/infobar_service.h
index 5df4c80a2e6d2dc7f4784b6673d33d69771ce1ab..6f398f7ceffe82eabd63edd972ab9c41f70df27c 100644
--- a/chrome/browser/infobars/infobar_service.h
+++ b/chrome/browser/infobars/infobar_service.h
@@ -21,9 +21,9 @@ class InfoBar;
// Associates a Tab to a InfoBarManager and manages its lifetime.
// It manages the infobar notifications and responds to navigation events.
-class InfoBarService : public content::WebContentsObserver,
- public content::WebContentsUserData<InfoBarService>,
- public InfoBarManager::Observer {
+class InfoBarService : public InfoBarManager,
+ public content::WebContentsObserver,
+ public content::WebContentsUserData<InfoBarService> {
public:
// Helper function to get the InfoBarManager attached to |web_contents|.
static InfoBarManager* InfoBarManagerFromWebContents(
@@ -33,18 +33,12 @@ class InfoBarService : public content::WebContentsObserver,
NavigationDetailsFromLoadCommittedDetails(
const content::LoadCommittedDetails& details);
- // These methods are simple pass-throughs to InfoBarManager, and are here to
- // prepare for the componentization of Infobars, see http://crbug.com/354379.
- InfoBar* AddInfoBar(scoped_ptr<InfoBar> infobar);
- InfoBar* ReplaceInfoBar(InfoBar* old_infobar,
- scoped_ptr<InfoBar> new_infobar);
-
// Retrieve the WebContents for the tab this service is associated with.
content::WebContents* web_contents() {
return content::WebContentsObserver::web_contents();
}
- InfoBarManager* infobar_manager() { return &infobar_manager_; }
+ InfoBarManager* infobar_manager() { return this; }
droger 2014/04/08 12:11:00 This method needs to be removed. I'll do this once
private:
friend class content::WebContentsUserData<InfoBarService>;
@@ -52,6 +46,14 @@ class InfoBarService : public content::WebContentsObserver,
explicit InfoBarService(content::WebContents* web_contents);
virtual ~InfoBarService();
+ // InfoBarManager:
+ // TODO(droger): Remove these functions once infobar notifications are
+ // removed. See http://crbug.com/354380
+ virtual void NotifyInfoBarAdded(InfoBar* infobar) OVERRIDE;
+ virtual void NotifyInfoBarRemoved(InfoBar* infobar, bool animate) OVERRIDE;
+ virtual void NotifyInfoBarReplaced(InfoBar* old_infobar,
+ InfoBar* new_infobar) OVERRIDE;
+
// content::WebContentsObserver:
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
virtual void NavigationEntryCommitted(
@@ -60,18 +62,10 @@ class InfoBarService : public content::WebContentsObserver,
content::WebContents* web_contents) OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
- // InfoBarManager::Observer:
- virtual void OnInfoBarAdded(InfoBar* infobar) OVERRIDE;
- virtual void OnInfoBarReplaced(InfoBar* old_infobar,
- InfoBar* new_infobar) OVERRIDE;
- virtual void OnInfoBarRemoved(InfoBar* infobar, bool animate) OVERRIDE;
- virtual void OnManagerShuttingDown(InfoBarManager* manager) OVERRIDE;
-
// Message handlers.
void OnDidBlockDisplayingInsecureContent();
void OnDidBlockRunningInsecureContent();
- InfoBarManager infobar_manager_;
DISALLOW_COPY_AND_ASSIGN(InfoBarService);
};

Powered by Google App Engine
This is Rietveld 408576698