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

Unified Diff: chrome/browser/download/download_request_infobar_delegate.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/download/download_request_infobar_delegate.h
===================================================================
--- chrome/browser/download/download_request_infobar_delegate.h (revision 175396)
+++ chrome/browser/download/download_request_infobar_delegate.h (working copy)
@@ -17,16 +17,28 @@
// on an unsuspecting user.
class DownloadRequestInfoBarDelegate : public ConfirmInfoBarDelegate {
public:
- DownloadRequestInfoBarDelegate(
- InfoBarService* infobar_service,
- DownloadRequestLimiter::TabDownloadState* host);
+ virtual ~DownloadRequestInfoBarDelegate();
+ // Creates a download request delegate and adds it to |infobar_service|.
+ static void Create(InfoBarService* infobar_service,
+ DownloadRequestLimiter::TabDownloadState* host);
+
+#if defined(UNIT_TEST)
+ static scoped_ptr<DownloadRequestInfoBarDelegate> Create(
+ DownloadRequestLimiter::TabDownloadState* host) {
+ return scoped_ptr<DownloadRequestInfoBarDelegate>(
+ new DownloadRequestInfoBarDelegate(NULL, host));
+ }
+#endif
+
void set_host(DownloadRequestLimiter::TabDownloadState* host) {
host_ = host;
}
private:
- virtual ~DownloadRequestInfoBarDelegate();
+ DownloadRequestInfoBarDelegate(
+ InfoBarService* infobar_service,
+ DownloadRequestLimiter::TabDownloadState* host);
// ConfirmInfoBarDelegate:
virtual gfx::Image* GetIcon() const OVERRIDE;

Powered by Google App Engine
This is Rietveld 408576698