summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/webui/active_downloads_ui.h
blob: a925eca5dd591ca9e71fcb0ff3be378b08636ee2 (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
// Copyright (c) 2011 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.

#ifndef CHROME_BROWSER_UI_WEBUI_ACTIVE_DOWNLOADS_UI_H_
#define CHROME_BROWSER_UI_WEBUI_ACTIVE_DOWNLOADS_UI_H_
#pragma once

#include <string>
#include <vector>

#include "chrome/browser/history/history.h"
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
#include "chrome/browser/ui/webui/html_dialog_ui.h"
#include "net/base/directory_lister.h"

class ActiveDownloadsHandler;
class Browser;
class Profile;

namespace content {
class DownloadItem;
}

class ActiveDownloadsUI : public HtmlDialogUI {
 public:
  explicit ActiveDownloadsUI(content::WebUI* web_ui);

  static bool ShouldShowPopup(Profile* profile,
                              content::DownloadItem* download);
  static Browser* OpenPopup(Profile* profile);
  static Browser* GetPopup();

  // For testing.
  typedef std::vector<content::DownloadItem*> DownloadList;
  const DownloadList& GetDownloads() const;

 private:
  ActiveDownloadsHandler* handler_;

  DISALLOW_COPY_AND_ASSIGN(ActiveDownloadsUI);
};

#endif  // CHROME_BROWSER_UI_WEBUI_ACTIVE_DOWNLOADS_UI_H_