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

Unified Diff: chrome/browser/download/download_request_manager.h

Issue 275011: Make the multiple download request dialog an infobar.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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_manager.h
===================================================================
--- chrome/browser/download/download_request_manager.h (revision 28899)
+++ chrome/browser/download/download_request_manager.h (working copy)
@@ -13,7 +13,7 @@
#include "chrome/common/notification_observer.h"
#include "chrome/common/notification_registrar.h"
-class DownloadRequestDialogDelegate;
+class DownloadRequestInfoBarDelegate;
class MessageLoop;
class NavigationController;
class TabContents;
@@ -60,8 +60,7 @@
};
// TabDownloadState maintains the download state for a particular tab.
- // TabDownloadState installs observers to update the download status
- // appropriately. Additionally TabDownloadState prompts the user as necessary.
+ // TabDownloadState prompts the user with an infobar as necessary.
// TabDownloadState deletes itself (by invoking
// DownloadRequestManager::Remove) as necessary.
class TabDownloadState : public NotificationObserver {
@@ -96,16 +95,25 @@
DownloadRequestManager::Callback* callback);
// Are we showing a prompt to the user?
- bool is_showing_prompt() const { return (dialog_delegate_ != NULL); }
+ bool is_showing_prompt() const { return (infobar_ != NULL); }
// NavigationController we're tracking.
NavigationController* controller() const { return controller_; }
// Invoked from DownloadRequestDialogDelegate. Notifies the delegates and
- // changes the status appropriately.
- void Cancel();
- void Accept();
+ // changes the status appropriately. Virtual for testing.
+ virtual void Cancel();
+ virtual void Accept();
+ protected:
+ // Used for testing.
+ TabDownloadState()
+ : host_(NULL),
+ controller_(NULL),
+ status_(DownloadRequestManager::ALLOW_ONE_DOWNLOAD),
+ infobar_(NULL) {
+ }
+
private:
// NotificationObserver method.
void Observe(NotificationType type,
@@ -134,8 +142,8 @@
// Used to remove observers installed on NavigationController.
NotificationRegistrar registrar_;
- // Handles showing the dialog to the user, may be null.
- DownloadRequestDialogDelegate* dialog_delegate_;
+ // Handles showing the infobar to the user, may be null.
+ DownloadRequestInfoBarDelegate* infobar_;
DISALLOW_COPY_AND_ASSIGN(TabDownloadState);
};

Powered by Google App Engine
This is Rietveld 408576698