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 "content/public/browser/download_item.h" | |
11 #include "content/public/browser/page_navigator.h" | |
12 #include "ui/gfx/image/image.h" | |
13 | |
14 class DownloadCommands { | |
15 public: | |
16 enum Command { | |
17 SHOW_IN_FOLDER = 1, // Open a folder view window with the item selected. | |
18 OPEN_WHEN_COMPLETE, // Open the download when it's finished. | |
19 ALWAYS_OPEN_TYPE, // Default this file extension to always open. | |
20 PLATFORM_OPEN, // Open using platform handler. | |
21 CANCEL, // Cancel the download. | |
22 PAUSE, // Pause a download. | |
23 RESUME, // Resume a download. | |
24 DISCARD, // Discard the malicious download. | |
25 KEEP, // Keep the malicious download. | |
26 RETRY, // Retry the download. | |
27 LEARN_MORE_SCANNING, // Show information about download scanning. | |
28 LEARN_MORE_INTERRUPTED,// Show information about interrupted downloads. | |
29 }; | |
30 | |
31 explicit DownloadCommands(content::DownloadItem* download_item); | |
32 virtual ~DownloadCommands() {} | |
33 | |
34 gfx::Image GetCommandIcon(Command command); | |
35 | |
36 base::string16 GetCommandString(Command command) const; | |
asanka
2015/02/13 21:17:05
Could you explain the intended difference between
yoshiki
2015/02/19 15:07:01
(however I removed these methods)
We show longer m
| |
37 base::string16 GetCommandStringForMenu(Command command) const; | |
38 | |
39 bool IsCommandEnabled(Command command) const; | |
40 bool IsCommandChecked(Command command) const; | |
41 bool IsCommandVisible(Command command) const; | |
42 void ExecuteCommand(Command command, content::PageNavigator* navigator); | |
43 | |
44 private: | |
45 #if defined(OS_WIN) || defined(OS_LINUX) || \ | |
46 (defined(OS_MACOSX) && !defined(OS_IOS)) | |
47 bool IsDownloadPdf() const; | |
48 bool CanOpenPdfInSystemViewer() const; | |
49 #endif | |
50 | |
51 int GetCommandStringIdInternal(Command command, bool for_menu) const; | |
52 int GetCommandIconId(Command command); | |
53 | |
54 int GetAlwaysOpenStringId() const; | |
55 | |
56 content::DownloadItem* download_item_; | |
57 }; | |
58 | |
59 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMMANDS_H_ | |
OLD | NEW |