| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // Logic for the download shelf context menu. Platform specific subclasses are | 44 // Logic for the download shelf context menu. Platform specific subclasses are |
| 45 // responsible for creating and running the menu. | 45 // responsible for creating and running the menu. |
| 46 class DownloadShelfContextMenu { | 46 class DownloadShelfContextMenu { |
| 47 public: | 47 public: |
| 48 virtual ~DownloadShelfContextMenu(); | 48 virtual ~DownloadShelfContextMenu(); |
| 49 | 49 |
| 50 protected: | 50 protected: |
| 51 explicit DownloadShelfContextMenu(BaseDownloadItemModel* download_model); | 51 explicit DownloadShelfContextMenu(BaseDownloadItemModel* download_model); |
| 52 | 52 |
| 53 enum ContextMenuCommands { | 53 enum ContextMenuCommands { |
| 54 SHOW_IN_FOLDER = 1, // Open a file explorer window with the item selected | 54 SHOW_IN_FOLDER = 1, // Open a file explorer window with the item selected. |
| 55 OPEN_WHEN_COMPLETE, // Open the download when it's finished | 55 OPEN_WHEN_COMPLETE, // Open the download when it's finished. |
| 56 ALWAYS_OPEN_TYPE, // Default this file extension to always open | 56 ALWAYS_OPEN_TYPE, // Default this file extension to always open. |
| 57 CANCEL, // Cancel the download | 57 CANCEL, // Cancel the download. |
| 58 REMOVE_ITEM, // Removes the item from the download shelf. |
| 58 MENU_LAST | 59 MENU_LAST |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 protected: | 62 protected: |
| 62 bool ItemIsChecked(int id) const; | 63 bool ItemIsChecked(int id) const; |
| 63 bool ItemIsDefault(int id) const; | 64 bool ItemIsDefault(int id) const; |
| 64 std::wstring GetItemLabel(int id) const; | 65 std::wstring GetItemLabel(int id) const; |
| 65 bool IsItemCommandEnabled(int id) const; | 66 bool IsItemCommandEnabled(int id) const; |
| 66 void ExecuteItemCommand(int id); | 67 void ExecuteItemCommand(int id); |
| 67 | 68 |
| 68 // Information source. | 69 // Information source. |
| 69 DownloadItem* download_; | 70 DownloadItem* download_; |
| 70 | 71 |
| 71 // A model to control the cancel behavior. | 72 // A model to control the cancel behavior. |
| 72 BaseDownloadItemModel* model_; | 73 BaseDownloadItemModel* model_; |
| 73 | 74 |
| 74 private: | 75 private: |
| 75 DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenu); | 76 DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenu); |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ | 79 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ |
| OLD | NEW |