OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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. | |
4 | |
5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMMANDS_H_ | |
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMMANDS_H_ | |
7 | |
8 #include "base/strings/string16.h" | |
9 | |
10 #include "chrome/browser/profiles/profile.h" | |
11 #include "content/public/browser/download_item.h" | |
12 #include "content/public/browser/page_navigator.h" | |
13 #include "ui/gfx/image/image.h" | |
14 | |
15 class DownloadCommands { | |
16 public: | |
17 enum Command { | |
18 SHOW_IN_FOLDER = 1, // Open a folder view window with the item selected. | |
19 OPEN_WHEN_COMPLETE, // Open the download when it's finished. | |
20 ALWAYS_OPEN_TYPE, // Default this file extension to always open. | |
21 PLATFORM_OPEN, // Open using platform handler. | |
22 CANCEL, // Cancel the download. | |
23 PAUSE, // Pause a download. | |
24 RESUME, // Resume a download. | |
25 DISCARD, // Discard the malicious download. | |
26 KEEP, // Keep the malicious download. | |
27 RETRY, // Retry the download. | |
28 LEARN_MORE_SCANNING, // Show information about download scanning. | |
29 LEARN_MORE_INTERRUPTED, // Show information about interrupted downloads. | |
30 }; | |
31 | |
32 explicit DownloadCommands(content::DownloadItem* download_item); | |
asanka
2015/02/27 01:26:49
Document that |download_item| must outlive Downloa
yoshiki
2015/02/28 10:50:53
Done.
| |
33 virtual ~DownloadCommands() {} | |
34 | |
35 gfx::Image GetCommandIcon(Command command); | |
36 | |
37 bool IsCommandEnabled(Command command) const; | |
38 bool IsCommandChecked(Command command) const; | |
39 bool IsCommandVisible(Command command) const; | |
40 void ExecuteCommand(Command command, Profile* profile); | |
41 | |
42 #if defined(OS_WIN) || defined(OS_LINUX) || \ | |
43 (defined(OS_MACOSX) && !defined(OS_IOS)) | |
44 bool IsDownloadPdf() const; | |
45 bool CanOpenPdfInSystemViewer() const; | |
46 #endif | |
47 | |
48 private: | |
49 int GetCommandIconId(Command command); | |
50 | |
51 int GetAlwaysOpenStringId() const; | |
52 | |
53 content::DownloadItem* download_item_; | |
54 }; | |
55 | |
56 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMMANDS_H_ | |
OLD | NEW |