| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMMANDS_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMMANDS_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMMANDS_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMMANDS_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "content/public/browser/download_item.h" | 11 #include "content/public/browser/download_item.h" |
| 12 #include "content/public/browser/page_navigator.h" | 12 #include "content/public/browser/page_navigator.h" |
| 13 #include "ui/gfx/image/image.h" | 13 #include "ui/gfx/image/image.h" |
| 14 | 14 |
| 15 class DownloadCommands { | 15 class DownloadCommands { |
| 16 public: | 16 public: |
| 17 enum Command { | 17 enum Command { |
| 18 SHOW_IN_FOLDER = 1, // Open a folder view window with the item selected. | 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. | 19 OPEN_WHEN_COMPLETE, // Open the download when it's finished. |
| 20 ALWAYS_OPEN_TYPE, // Default this file extension to always open. | 20 ALWAYS_OPEN_TYPE, // Default this file extension to always open. |
| 21 PLATFORM_OPEN, // Open using platform handler. | 21 PLATFORM_OPEN, // Open using platform handler. |
| 22 CANCEL, // Cancel the download. | 22 CANCEL, // Cancel the download. |
| 23 PAUSE, // Pause a download. | 23 PAUSE, // Pause a download. |
| 24 RESUME, // Resume a download. | 24 RESUME, // Resume a download. |
| 25 DISCARD, // Discard the malicious download. | 25 DISCARD, // Discard the malicious download. |
| 26 KEEP, // Keep the malicious download. | 26 KEEP, // Keep the malicious download. |
| 27 RETRY, // Retry the download. | 27 RETRY, // Resume a download (Same as RESUME, except label) |
| 28 LEARN_MORE_SCANNING, // Show information about download scanning. | 28 LEARN_MORE_SCANNING, // Show information about download scanning. |
| 29 LEARN_MORE_INTERRUPTED, // Show information about interrupted downloads. | 29 LEARN_MORE_INTERRUPTED, // Show information about interrupted downloads. |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 // |download_item| must outlive DownloadCommands. | 32 // |download_item| must outlive DownloadCommands. |
| 33 explicit DownloadCommands(content::DownloadItem* download_item); | 33 explicit DownloadCommands(content::DownloadItem* download_item); |
| 34 virtual ~DownloadCommands() {} | 34 virtual ~DownloadCommands() {} |
| 35 | 35 |
| 36 gfx::Image GetCommandIcon(Command command); | 36 gfx::Image GetCommandIcon(Command command); |
| 37 | 37 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 52 GetLearnMoreURLForInterruptedDownload_ContainsContext); | 52 GetLearnMoreURLForInterruptedDownload_ContainsContext); |
| 53 | 53 |
| 54 Browser* GetBrowser() const; | 54 Browser* GetBrowser() const; |
| 55 int GetCommandIconId(Command command) const; | 55 int GetCommandIconId(Command command) const; |
| 56 GURL GetLearnMoreURLForInterruptedDownload() const; | 56 GURL GetLearnMoreURLForInterruptedDownload() const; |
| 57 | 57 |
| 58 content::DownloadItem* const download_item_; | 58 content::DownloadItem* const download_item_; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMMANDS_H_ | 61 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_COMMANDS_H_ |
| OLD | NEW |