Index: chrome/browser/download/download_shelf_context_menu.h |
diff --git a/chrome/browser/download/download_shelf_context_menu.h b/chrome/browser/download/download_shelf_context_menu.h |
index ecf9d99f38d54e22f46cb478a813b5137e2aac3a..99356f893f0df1a9e6fbe69479d5092d0a6fa16c 100644 |
--- a/chrome/browser/download/download_shelf_context_menu.h |
+++ b/chrome/browser/download/download_shelf_context_menu.h |
@@ -9,6 +9,7 @@ |
#include "base/compiler_specific.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/strings/string16.h" |
+#include "chrome/browser/download/download_command.h" |
#include "content/public/browser/download_item.h" |
#include "ui/base/models/simple_menu_model.h" |
@@ -24,19 +25,6 @@ class PageNavigator; |
class DownloadShelfContextMenu : public ui::SimpleMenuModel::Delegate, |
public content::DownloadItem::Observer { |
public: |
- enum ContextMenuCommands { |
- SHOW_IN_FOLDER = 1, // Open a folder view window with the item selected. |
- OPEN_WHEN_COMPLETE, // Open the download when it's finished. |
- ALWAYS_OPEN_TYPE, // Default this file extension to always open. |
- PLATFORM_OPEN, // Open using platform handler. |
- CANCEL, // Cancel the download. |
- TOGGLE_PAUSE, // Pause or resume a download. |
- DISCARD, // Discard the malicious download. |
- KEEP, // Keep the malicious download. |
- LEARN_MORE_SCANNING, // Show information about download scanning. |
- LEARN_MORE_INTERRUPTED,// Show information about interrupted downloads. |
- }; |
- |
~DownloadShelfContextMenu() override; |
content::DownloadItem* download_item() const { return download_item_; } |
@@ -60,6 +48,8 @@ class DownloadShelfContextMenu : public ui::SimpleMenuModel::Delegate, |
base::string16 GetLabelForCommandId(int command_id) const override; |
private: |
+ int GetStringIdForCommand(DownloadCommand::Commands command) const; |
+ |
// Detaches self from |download_item_|. Called when the DownloadItem is |
// destroyed or when this object is being destroyed. |
void DetachFromDownloadItem(); |
@@ -73,14 +63,6 @@ class DownloadShelfContextMenu : public ui::SimpleMenuModel::Delegate, |
ui::SimpleMenuModel* GetMaybeMaliciousMenuModel(); |
ui::SimpleMenuModel* GetMaliciousMenuModel(); |
- int GetAlwaysOpenStringId() const; |
- |
-#if defined(OS_WIN) || defined(OS_LINUX) || \ |
- (defined(OS_MACOSX) && !defined(OS_IOS)) |
- bool IsDownloadPdf() const; |
- bool CanOpenPdfInSystemViewer() const; |
-#endif |
- |
// We show slightly different menus if the download is in progress vs. if the |
// download has finished. |
scoped_ptr<ui::SimpleMenuModel> in_progress_download_menu_model_; |
@@ -91,6 +73,7 @@ class DownloadShelfContextMenu : public ui::SimpleMenuModel::Delegate, |
// Information source. |
content::DownloadItem* download_item_; |
+ DownloadCommand download_command_; |
// Used to open tabs. |
content::PageNavigator* navigator_; |