1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_DOWNLOAD_TEST_DOWNLOAD_SHELF_H_
6 #define CHROME_BROWSER_DOWNLOAD_TEST_DOWNLOAD_SHELF_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/ref_counted.h"
11 #include "chrome/browser/download/download_shelf.h"
12 #include "content/public/browser/download_manager.h"
14 // An implementation of DownloadShelf for testing.
15 class TestDownloadShelf
: public DownloadShelf
,
16 public content::DownloadManager::Observer
{
19 virtual ~TestDownloadShelf();
22 virtual bool IsShowing() const OVERRIDE
;
23 virtual bool IsClosing() const OVERRIDE
;
24 virtual Browser
* browser() const OVERRIDE
;
26 // Return |true| if a download was added to this shelf.
27 bool did_add_download() const { return did_add_download_
; }
29 // Set download_manager_ (and the result of calling GetDownloadManager())
30 void set_download_manager(content::DownloadManager
* download_manager
);
32 // DownloadManager::Observer implementation.
33 virtual void ManagerGoingDown(content::DownloadManager
* manager
) OVERRIDE
;
36 virtual void DoAddDownload(content::DownloadItem
* download
) OVERRIDE
;
37 virtual void DoShow() OVERRIDE
;
38 virtual void DoClose(CloseReason reason
) OVERRIDE
;
39 virtual base::TimeDelta
GetTransientDownloadShowDelay() OVERRIDE
;
40 virtual content::DownloadManager
* GetDownloadManager() OVERRIDE
;
44 bool did_add_download_
;
45 content::DownloadManager
* download_manager_
;
47 DISALLOW_COPY_AND_ASSIGN(TestDownloadShelf
);
50 #endif // CHROME_BROWSER_DOWNLOAD_TEST_DOWNLOAD_SHELF_H_