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_DOWNLOADS_DOM_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_DOWNLOADS_DOM_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_DOWNLOADS_DOM_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_DOWNLOADS_DOM_HANDLER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // observing so that RemoveObserver will be called for all of them. | 100 // observing so that RemoveObserver will be called for all of them. |
101 typedef std::set<content::DownloadItem*> DownloadSet; | 101 typedef std::set<content::DownloadItem*> DownloadSet; |
102 | 102 |
103 // Schedules a call to SendCurrentDownloads() in the next message loop | 103 // Schedules a call to SendCurrentDownloads() in the next message loop |
104 // iteration. | 104 // iteration. |
105 void ScheduleSendCurrentDownloads(); | 105 void ScheduleSendCurrentDownloads(); |
106 | 106 |
107 // Sends the current list of downloads to the page. | 107 // Sends the current list of downloads to the page. |
108 void SendCurrentDownloads(); | 108 void SendCurrentDownloads(); |
109 | 109 |
110 // Fills |downloads| with all the items for both DownloadManagers matching | 110 // Fills |downloads| with all the items for both DownloadManagers. |
111 // |search_text_|. | 111 void GetAllDownloads(content::DownloadManager::DownloadVector* downloads); |
112 void SearchDownloads(content::DownloadManager::DownloadVector* downloads); | |
113 | 112 |
114 // Clears all download items and their observers. | 113 // Clears all download items and their observers. |
115 void ClearDownloadItems(); | 114 void ClearDownloadItems(); |
116 | 115 |
117 // Displays a native prompt asking the user for confirmation after accepting | 116 // Displays a native prompt asking the user for confirmation after accepting |
118 // the dangerous download specified by |dangerous|. The function returns | 117 // the dangerous download specified by |dangerous|. The function returns |
119 // immediately, and will invoke DangerPromptAccepted() asynchronously if the | 118 // immediately, and will invoke DangerPromptAccepted() asynchronously if the |
120 // user accepts the dangerous download. The native prompt will observe | 119 // user accepts the dangerous download. The native prompt will observe |
121 // |dangerous| until either the dialog is dismissed or |dangerous| is no | 120 // |dangerous| until either the dialog is dismissed or |dangerous| is no |
122 // longer an in-progress dangerous download. | 121 // longer an in-progress dangerous download. |
(...skipping 23 matching lines...) Expand all Loading... |
146 | 145 |
147 // Whether a call to SendCurrentDownloads() is currently scheduled. | 146 // Whether a call to SendCurrentDownloads() is currently scheduled. |
148 bool update_scheduled_; | 147 bool update_scheduled_; |
149 | 148 |
150 base::WeakPtrFactory<DownloadsDOMHandler> weak_ptr_factory_; | 149 base::WeakPtrFactory<DownloadsDOMHandler> weak_ptr_factory_; |
151 | 150 |
152 DISALLOW_COPY_AND_ASSIGN(DownloadsDOMHandler); | 151 DISALLOW_COPY_AND_ASSIGN(DownloadsDOMHandler); |
153 }; | 152 }; |
154 | 153 |
155 #endif // CHROME_BROWSER_UI_WEBUI_DOWNLOADS_DOM_HANDLER_H_ | 154 #endif // CHROME_BROWSER_UI_WEBUI_DOWNLOADS_DOM_HANDLER_H_ |
OLD | NEW |