summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/test_download_shelf.cc
blob: c28cb0382f4fda4f408aedda7f82c7ea62b63bda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/download/test_download_shelf.h"

#include "content/public/browser/download_manager.h"

TestDownloadShelf::TestDownloadShelf()
    : is_showing_(false),
      did_add_download_(false) {
}

TestDownloadShelf::~TestDownloadShelf() {
}

bool TestDownloadShelf::IsShowing() const {
  return is_showing_;
}

bool TestDownloadShelf::IsClosing() const {
  return false;
}

Browser* TestDownloadShelf::browser() const {
  return NULL;
}

void TestDownloadShelf::set_download_manager(
    content::DownloadManager* download_manager) {
  download_manager_ = download_manager;
}

void TestDownloadShelf::DoAddDownload(content::DownloadItem* download) {
  did_add_download_ = true;
}

void TestDownloadShelf::DoShow() {
  is_showing_ = true;
}

void TestDownloadShelf::DoClose(CloseReason reason) {
  is_showing_ = false;
}

base::TimeDelta TestDownloadShelf::GetTransientDownloadShowDelay() {
  return base::TimeDelta();
}

content::DownloadManager* TestDownloadShelf::GetDownloadManager() {
  return download_manager_.get();
}