Switch global error menu icon to vectorized MD asset
[chromium-blink-merge.git] / chrome / browser / download / test_download_shelf.cc
blob9538b7cdc0a8694ec344ba874c4621da833b02cd
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()
10 : is_showing_(false),
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 {
21 return is_showing_;
24 bool TestDownloadShelf::IsClosing() const {
25 return false;
28 Browser* TestDownloadShelf::browser() const {
29 return NULL;
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() {
51 is_showing_ = true;
54 void TestDownloadShelf::DoClose(CloseReason reason) {
55 is_showing_ = false;
58 base::TimeDelta TestDownloadShelf::GetTransientDownloadShowDelay() {
59 return base::TimeDelta();
62 content::DownloadManager* TestDownloadShelf::GetDownloadManager() {
63 return download_manager_;