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

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: review comments 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
« no previous file with comments | « chrome/browser/infobars/infobar_manager.cc ('k') | chrome/browser/infobars/infobar_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..152a5f732a98483d231bc88d72011acbf4041a3a 100644
--- a/chrome/browser/infobars/infobar_service.h
+++ b/chrome/browser/infobars/infobar_service.h
@@ -21,37 +21,38 @@ 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(
- content::WebContents* web_contents);
-
static InfoBarDelegate::NavigationDetails
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);
+ // This function must only be called on infobars that are owned by an
+ // InfoBarService instance (or not owned at all, in which case this returns
+ // NULL).
+ static content::WebContents* WebContentsFromInfoBar(InfoBar* 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_; }
-
private:
friend class content::WebContentsUserData<InfoBarService>;
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 +61,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);
};
« no previous file with comments | « chrome/browser/infobars/infobar_manager.cc ('k') | chrome/browser/infobars/infobar_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698