| 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 CONTENT_PUBLIC_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_H_ | 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "content/public/browser/download_item.h" | 10 #include "content/public/browser/download_item.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // Returns the singleton instance of the DownloadControllerAndroid. | 21 // Returns the singleton instance of the DownloadControllerAndroid. |
| 22 static DownloadControllerAndroid* Get(); | 22 static DownloadControllerAndroid* Get(); |
| 23 | 23 |
| 24 // Called to set the DownloadControllerAndroid instance. | 24 // Called to set the DownloadControllerAndroid instance. |
| 25 static void SetDownloadControllerAndroid( | 25 static void SetDownloadControllerAndroid( |
| 26 DownloadControllerAndroid* download_controller); | 26 DownloadControllerAndroid* download_controller); |
| 27 | 27 |
| 28 // Starts a new download request with Android. Should be called on the | 28 // Starts a new download request with Android. Should be called on the |
| 29 // UI thread. | 29 // UI thread. |
| 30 virtual void CreateGETDownload(int render_process_id, int render_view_id, | 30 virtual void CreateGETDownload(int render_process_id, int render_view_id, |
| 31 int request_id) = 0; | 31 int request_id, bool must_download) = 0; |
| 32 | 32 |
| 33 // Should be called when a download is started. It can be either a GET | 33 // Should be called when a download is started. It can be either a GET |
| 34 // request with authentication or a POST request. Notifies the embedding | 34 // request with authentication or a POST request. Notifies the embedding |
| 35 // app about the download. Should be called on the UI thread. | 35 // app about the download. Should be called on the UI thread. |
| 36 virtual void OnDownloadStarted(DownloadItem* download_item) = 0; | 36 virtual void OnDownloadStarted(DownloadItem* download_item) = 0; |
| 37 | 37 |
| 38 // Called when a download is initiated by context menu. | 38 // Called when a download is initiated by context menu. |
| 39 virtual void StartContextMenuDownload( | 39 virtual void StartContextMenuDownload( |
| 40 const ContextMenuParams& params, WebContents* web_contents, | 40 const ContextMenuParams& params, WebContents* web_contents, |
| 41 bool is_link, const std::string& extra_headers) = 0; | 41 bool is_link, const std::string& extra_headers) = 0; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 63 virtual void SetDefaultDownloadFileName(const std::string& file_name) {} | 63 virtual void SetDefaultDownloadFileName(const std::string& file_name) {} |
| 64 | 64 |
| 65 protected: | 65 protected: |
| 66 ~DownloadControllerAndroid() override {}; | 66 ~DownloadControllerAndroid() override {}; |
| 67 static DownloadControllerAndroid* download_controller_; | 67 static DownloadControllerAndroid* download_controller_; |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace content | 70 } // namespace content |
| 71 | 71 |
| 72 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_H_ | 72 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_H_ |
| OLD | NEW |