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 #include "chrome/browser/download/test_download_shelf.h"
7 #include "content/public/browser/download_manager.h"
9 TestDownloadShelf::TestDownloadShelf()
11 did_add_download_(false),
12 download_manager_(NULL
) {
15 TestDownloadShelf::~TestDownloadShelf() {
16 if (download_manager_
)
17 download_manager_
->RemoveObserver(this);
20 bool TestDownloadShelf::IsShowing() const {
24 bool TestDownloadShelf::IsClosing() const {
28 Browser
* TestDownloadShelf::browser() const {
32 void TestDownloadShelf::set_download_manager(
33 content::DownloadManager
* download_manager
) {
34 if (download_manager_
)
35 download_manager_
->RemoveObserver(this);
36 download_manager_
= download_manager
;
37 if (download_manager_
)
38 download_manager_
->AddObserver(this);
41 void TestDownloadShelf::ManagerGoingDown(content::DownloadManager
* manager
) {
42 DCHECK_EQ(manager
, download_manager_
);
43 download_manager_
= NULL
;
46 void TestDownloadShelf::DoAddDownload(content::DownloadItem
* download
) {
47 did_add_download_
= true;
50 void TestDownloadShelf::DoShow() {
54 void TestDownloadShelf::DoClose(CloseReason reason
) {
58 base::TimeDelta
TestDownloadShelf::GetTransientDownloadShowDelay() {
59 return base::TimeDelta();
62 content::DownloadManager
* TestDownloadShelf::GetDownloadManager() {
63 return download_manager_
;