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

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

Issue 11644059: Change infobar creation to use a public static Create() method on the infobar delegate classes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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/api/infobars/infobar_service.h
===================================================================
--- chrome/browser/api/infobars/infobar_service.h (revision 175396)
+++ chrome/browser/api/infobars/infobar_service.h (working copy)
@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_API_INFOBARS_INFOBAR_SERVICE_H_
#define CHROME_BROWSER_API_INFOBARS_INFOBAR_SERVICE_H_
-#include <cstddef>
+#include "base/memory/scoped_ptr.h"
namespace content {
class WebContents;
@@ -35,8 +35,8 @@
// which returns true for InfoBarDelegate::EqualsDelegate(delegate),
// |delegate| is closed immediately without being added.
//
- // Returns whether |delegate| was successfully added.
- virtual bool AddInfoBar(InfoBarDelegate* delegate) = 0;
+ // Returns the delegate if it was successfully added.
+ virtual InfoBarDelegate* AddInfoBar(scoped_ptr<InfoBarDelegate> delegate) = 0;
// Removes the InfoBar for the specified |delegate|.
//
@@ -50,16 +50,18 @@
// If infobars are disabled for this tab, |new_delegate| is closed immediately
// without being added, and nothing else happens.
//
- // Returns whether |new_delegate| was successfully added.
+ // Returns the new delegate if it was successfully added.
//
// NOTE: This does not perform any EqualsDelegate() checks like AddInfoBar().
- virtual bool ReplaceInfoBar(InfoBarDelegate* old_delegate,
- InfoBarDelegate* new_delegate) = 0;
+ virtual InfoBarDelegate* ReplaceInfoBar(
+ InfoBarDelegate* old_delegate,
+ scoped_ptr<InfoBarDelegate> new_delegate) = 0;
// Returns the number of infobars for this tab.
virtual size_t GetInfoBarCount() const = 0;
- // Returns the infobar at the given |index|.
+ // Returns the infobar delegate at the given |index|. The InfoBarService
+ // retains ownership.
//
// Warning: Does not sanity check |index|.
virtual InfoBarDelegate* GetInfoBarDelegateAt(size_t index) = 0;
« no previous file with comments | « chrome/browser/api/infobars/infobar_delegate.cc ('k') | chrome/browser/api/infobars/simple_alert_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698