diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-25 21:52:52 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-25 21:52:52 +0000 |
commit | 546176cb659dcff9b31fb4dbee85ad24b0c8eec7 (patch) | |
tree | 804b570e25dfdf1c99c6bb96786a360b39a3f838 /chrome/browser/views/download_item_view.cc | |
parent | e9210915326b600a7efc8aa6d1befba549347fe5 (diff) | |
download | chromium_src-546176cb659dcff9b31fb4dbee85ad24b0c8eec7.zip chromium_src-546176cb659dcff9b31fb4dbee85ad24b0c8eec7.tar.gz chromium_src-546176cb659dcff9b31fb4dbee85ad24b0c8eec7.tar.bz2 |
Don't make pause/resume item in download context menu a check item (the name already toggles between pause and resume)
also, share more code between windows and linux. DownloadShelfContextMenu{Win,Linux} don't need to both implement menus::SimpleMenuModel::Delegate.
BUG=24759
TEST=download item context menu still works.
Review URL: http://codereview.chromium.org/652200
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40051 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/download_item_view.cc')
-rw-r--r-- | chrome/browser/views/download_item_view.cc | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/chrome/browser/views/download_item_view.cc b/chrome/browser/views/download_item_view.cc index af57050..12877c8 100644 --- a/chrome/browser/views/download_item_view.cc +++ b/chrome/browser/views/download_item_view.cc @@ -75,8 +75,7 @@ static const double kDownloadItemLuminanceMod = 0.8; // DownloadShelfContextMenuWin ------------------------------------------------- -class DownloadShelfContextMenuWin : public DownloadShelfContextMenu, - public menus::SimpleMenuModel::Delegate { +class DownloadShelfContextMenuWin : public DownloadShelfContextMenu { public: explicit DownloadShelfContextMenuWin(BaseDownloadItemModel* model) : DownloadShelfContextMenu(model) { @@ -85,9 +84,9 @@ class DownloadShelfContextMenuWin : public DownloadShelfContextMenu, void Run(const gfx::Point& point) { if (download_->state() == DownloadItem::COMPLETE) - menu_.reset(new views::Menu2(GetFinishedMenuModel(this))); + menu_.reset(new views::Menu2(GetFinishedMenuModel())); else - menu_.reset(new views::Menu2(GetInProgressMenuModel(this))); + menu_.reset(new views::Menu2(GetInProgressMenuModel())); // The menu's alignment is determined based on the UI layout. views::Menu2::Alignment alignment; @@ -102,41 +101,6 @@ class DownloadShelfContextMenuWin : public DownloadShelfContextMenu, // to access |download_|. void Stop() { download_ = NULL; - model_ = NULL; - } - - // Overriden from menus::SimpleMenuModel::Delegate: - - virtual bool IsCommandIdChecked(int command_id) const { - if (!download_) - return false; - return ItemIsChecked(command_id); - } - - virtual bool IsCommandIdEnabled(int command_id) const { - if (!download_) - return false; - return IsItemCommandEnabled(command_id); - } - - virtual bool GetAcceleratorForCommandId( - int command_id, - menus::Accelerator* accelerator) { - return false; - } - - bool IsLabelForCommandIdDynamic(int command_id) const { - return command_id == TOGGLE_PAUSE; - } - - string16 GetLabelForCommandId(int command_id) const { - DCHECK(command_id == TOGGLE_PAUSE); - return WideToUTF16(GetItemLabel(command_id)); - } - - virtual void ExecuteCommand(int command_id) { - if (download_) - ExecuteItemCommand(command_id); } private: |