| 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 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 virtual Browser* browser() const = 0; | 41 virtual Browser* browser() const = 0; |
| 42 }; | 42 }; |
| 43 | 43 |
| 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 virtual DownloadItem* download() const { return download_; } |
| 51 |
| 50 protected: | 52 protected: |
| 51 explicit DownloadShelfContextMenu(BaseDownloadItemModel* download_model); | 53 explicit DownloadShelfContextMenu(BaseDownloadItemModel* download_model); |
| 52 | 54 |
| 53 enum ContextMenuCommands { | 55 enum ContextMenuCommands { |
| 54 SHOW_IN_FOLDER = 1, // Open a file explorer window with the item selected. | 56 SHOW_IN_FOLDER = 1, // Open a file explorer window with the item selected. |
| 55 OPEN_WHEN_COMPLETE, // Open the download when it's finished. | 57 OPEN_WHEN_COMPLETE, // Open the download when it's finished. |
| 56 ALWAYS_OPEN_TYPE, // Default this file extension to always open. | 58 ALWAYS_OPEN_TYPE, // Default this file extension to always open. |
| 57 CANCEL, // Cancel the download. | 59 CANCEL, // Cancel the download. |
| 58 REMOVE_ITEM, // Removes the item from the download shelf. | 60 REMOVE_ITEM, // Removes the item from the download shelf. |
| 59 TOGGLE_PAUSE, // Temporarily pause a download. | 61 TOGGLE_PAUSE, // Temporarily pause a download. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 71 DownloadItem* download_; | 73 DownloadItem* download_; |
| 72 | 74 |
| 73 // A model to control the cancel behavior. | 75 // A model to control the cancel behavior. |
| 74 BaseDownloadItemModel* model_; | 76 BaseDownloadItemModel* model_; |
| 75 | 77 |
| 76 private: | 78 private: |
| 77 DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenu); | 79 DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenu); |
| 78 }; | 80 }; |
| 79 | 81 |
| 80 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ | 82 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ |
| OLD | NEW |