| 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 namespace content { | 8 namespace content { |
| 9 class DownloadItem; | 9 class DownloadItem; |
| 10 class RenderViewHost; | 10 class RenderViewHost; |
| 11 class WebContents; | 11 class WebContents; |
| 12 | 12 |
| 13 // Interface to request GET downloads and send notifications for POST | 13 // Interface to request GET downloads and send notifications for POST |
| 14 // downloads. | 14 // downloads. |
| 15 class DownloadControllerAndroid { | 15 class DownloadControllerAndroid { |
| 16 public: | 16 public: |
| 17 // Returns the singleton instance of the DownloadControllerAndroid. | 17 // Returns the singleton instance of the DownloadControllerAndroid. |
| 18 static DownloadControllerAndroid* Get(); | 18 static DownloadControllerAndroid* Get(); |
| 19 | 19 |
| 20 // Starts a new download request with Android. Should be called on the | 20 // Starts a new download request with Android. Should be called on the |
| 21 // UI thread. | 21 // UI thread. |
| 22 virtual void CreateGETDownload(RenderViewHost* source, int request_id) = 0; | 22 virtual void CreateGETDownload(RenderViewHost* source, int request_id) = 0; |
| 23 | 23 |
| 24 // Should be called when a POST download is started. Notifies the embedding | 24 // Should be called when a POST download is started. Notifies the embedding |
| 25 // app about the download. Should be called on the UI thread. | 25 // app about the download. Should be called on the UI thread. |
| 26 virtual void OnPostDownloadStarted(WebContents* web_contents, | 26 virtual void OnPostDownloadStarted(DownloadItem* download_item) = 0; |
| 27 DownloadItem* download_item) = 0; | |
| 28 protected: | 27 protected: |
| 29 virtual ~DownloadControllerAndroid() {}; | 28 virtual ~DownloadControllerAndroid() {}; |
| 30 }; | 29 }; |
| 31 | 30 |
| 32 } // namespace content | 31 } // namespace content |
| 33 | 32 |
| 34 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_H_ | 33 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_H_ |
| OLD | NEW |