| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SHELF_CONTEXT_MENU_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 DownloadShelfContextMenu(content::DownloadItem* download_item, | 45 DownloadShelfContextMenu(content::DownloadItem* download_item, |
| 46 content::PageNavigator* navigator); | 46 content::PageNavigator* navigator); |
| 47 | 47 |
| 48 // Returns the correct menu model depending on the state of the download item. | 48 // Returns the correct menu model depending on the state of the download item. |
| 49 // Returns NULL if the download was destroyed. | 49 // Returns NULL if the download was destroyed. |
| 50 ui::SimpleMenuModel* GetMenuModel(); | 50 ui::SimpleMenuModel* GetMenuModel(); |
| 51 | 51 |
| 52 // ui::SimpleMenuModel::Delegate: | 52 // ui::SimpleMenuModel::Delegate: |
| 53 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 53 virtual bool IsCommandIdEnabled(int command_id) const override; |
| 54 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 54 virtual bool IsCommandIdChecked(int command_id) const override; |
| 55 virtual bool IsCommandIdVisible(int command_id) const OVERRIDE; | 55 virtual bool IsCommandIdVisible(int command_id) const override; |
| 56 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | 56 virtual void ExecuteCommand(int command_id, int event_flags) override; |
| 57 virtual bool GetAcceleratorForCommandId( | 57 virtual bool GetAcceleratorForCommandId( |
| 58 int command_id, | 58 int command_id, |
| 59 ui::Accelerator* accelerator) OVERRIDE; | 59 ui::Accelerator* accelerator) override; |
| 60 virtual bool IsItemForCommandIdDynamic(int command_id) const OVERRIDE; | 60 virtual bool IsItemForCommandIdDynamic(int command_id) const override; |
| 61 virtual base::string16 GetLabelForCommandId(int command_id) const OVERRIDE; | 61 virtual base::string16 GetLabelForCommandId(int command_id) const override; |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 // Detaches self from |download_item_|. Called when the DownloadItem is | 64 // Detaches self from |download_item_|. Called when the DownloadItem is |
| 65 // destroyed or when this object is being destroyed. | 65 // destroyed or when this object is being destroyed. |
| 66 void DetachFromDownloadItem(); | 66 void DetachFromDownloadItem(); |
| 67 | 67 |
| 68 // content::DownloadItem::Observer | 68 // content::DownloadItem::Observer |
| 69 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; | 69 virtual void OnDownloadDestroyed(content::DownloadItem* download) override; |
| 70 | 70 |
| 71 ui::SimpleMenuModel* GetInProgressMenuModel(); | 71 ui::SimpleMenuModel* GetInProgressMenuModel(); |
| 72 ui::SimpleMenuModel* GetFinishedMenuModel(); | 72 ui::SimpleMenuModel* GetFinishedMenuModel(); |
| 73 ui::SimpleMenuModel* GetInterruptedMenuModel(); | 73 ui::SimpleMenuModel* GetInterruptedMenuModel(); |
| 74 ui::SimpleMenuModel* GetMaybeMaliciousMenuModel(); | 74 ui::SimpleMenuModel* GetMaybeMaliciousMenuModel(); |
| 75 ui::SimpleMenuModel* GetMaliciousMenuModel(); | 75 ui::SimpleMenuModel* GetMaliciousMenuModel(); |
| 76 | 76 |
| 77 int GetAlwaysOpenStringId() const; | 77 int GetAlwaysOpenStringId() const; |
| 78 | 78 |
| 79 #if defined(OS_WIN) | 79 #if defined(OS_WIN) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 96 content::PageNavigator* navigator_; | 96 content::PageNavigator* navigator_; |
| 97 | 97 |
| 98 #if defined(OS_WIN) | 98 #if defined(OS_WIN) |
| 99 bool is_pdf_reader_up_to_date_; | 99 bool is_pdf_reader_up_to_date_; |
| 100 #endif | 100 #endif |
| 101 | 101 |
| 102 DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenu); | 102 DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenu); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_H_ | 105 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_CONTEXT_MENU_H_ |
| OLD | NEW |