| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_WEBUI_MD_DOWNLOADS_MD_DOWNLOADS_DOM_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_MD_DOWNLOADS_MD_DOWNLOADS_DOM_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_MD_DOWNLOADS_MD_DOWNLOADS_DOM_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_MD_DOWNLOADS_MD_DOWNLOADS_DOM_HANDLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 // Returns the download that is referred to in a given value. | 127 // Returns the download that is referred to in a given value. |
| 128 content::DownloadItem* GetDownloadByValue(const base::ListValue* args); | 128 content::DownloadItem* GetDownloadByValue(const base::ListValue* args); |
| 129 | 129 |
| 130 // Returns the download with |id| or NULL if it doesn't exist. | 130 // Returns the download with |id| or NULL if it doesn't exist. |
| 131 content::DownloadItem* GetDownloadById(uint32_t id); | 131 content::DownloadItem* GetDownloadById(uint32_t id); |
| 132 | 132 |
| 133 // Remove all downloads in |to_remove| with the ability to undo removal later. | 133 // Remove all downloads in |to_remove| with the ability to undo removal later. |
| 134 void RemoveDownloads(const DownloadVector& to_remove); | 134 void RemoveDownloads(const DownloadVector& to_remove); |
| 135 | 135 |
| 136 // Removes the download specified by an ID from JavaScript in |args|. |
| 137 void RemoveDownloadInArgs(const base::ListValue* args); |
| 138 |
| 136 // Checks whether a download's file was removed from its original location. | 139 // Checks whether a download's file was removed from its original location. |
| 137 void CheckForRemovedFiles(); | 140 void CheckForRemovedFiles(); |
| 138 | 141 |
| 139 DownloadsListTracker list_tracker_; | 142 DownloadsListTracker list_tracker_; |
| 140 | 143 |
| 141 // IDs of downloads to remove when this handler gets deleted. | 144 // IDs of downloads to remove when this handler gets deleted. |
| 142 std::vector<IdSet> removals_; | 145 std::vector<IdSet> removals_; |
| 143 | 146 |
| 144 base::WeakPtrFactory<MdDownloadsDOMHandler> weak_ptr_factory_; | 147 base::WeakPtrFactory<MdDownloadsDOMHandler> weak_ptr_factory_; |
| 145 | 148 |
| 146 DISALLOW_COPY_AND_ASSIGN(MdDownloadsDOMHandler); | 149 DISALLOW_COPY_AND_ASSIGN(MdDownloadsDOMHandler); |
| 147 }; | 150 }; |
| 148 | 151 |
| 149 #endif // CHROME_BROWSER_UI_WEBUI_MD_DOWNLOADS_MD_DOWNLOADS_DOM_HANDLER_H_ | 152 #endif // CHROME_BROWSER_UI_WEBUI_MD_DOWNLOADS_MD_DOWNLOADS_DOM_HANDLER_H_ |
| OLD | NEW |