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 bool IsCommandEnabled(Command command) const; |
| 37 bool IsCommandChecked(Command command) const; |
| 38 bool IsCommandVisible(Command command) const; |
| 39 void ExecuteCommand(Command command, content::PageNavigator* navigator); |
| 40 |
| 41 #if defined(OS_WIN) || defined(OS_LINUX) || \ |
| 42 (defined(OS_MACOSX) && !defined(OS_IOS)) |
| 43 bool IsDownloadPdf() const; |
| 44 bool CanOpenPdfInSystemViewer() const; |
| 45 #endif |
| 46 |
| 47 private: |
| 48 int GetCommandIconId(Command command); |
| 49 |
| 50 int GetAlwaysOpenStringId() const; |
| 51 |
| 52 content::DownloadItem* download_item_; |
| 53 }; |
| 54 |
| 55 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMMANDS_H_ |
OLD | NEW |