| 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 // This class pairs with DownloadController on Java side to forward requests | 5 // This class pairs with DownloadController on Java side to forward requests |
| 6 // for GET downloads to the current DownloadListener. POST downloads are | 6 // for GET downloads to the current DownloadListener. POST downloads are |
| 7 // handled on the native side. | 7 // handled on the native side. |
| 8 // | 8 // |
| 9 // Both classes are Singleton classes. C++ object owns Java object. | 9 // Both classes are Singleton classes. C++ object owns Java object. |
| 10 // | 10 // |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 static bool RegisterDownloadController(JNIEnv* env); | 49 static bool RegisterDownloadController(JNIEnv* env); |
| 50 | 50 |
| 51 // Called when DownloadController Java object is instantiated. | 51 // Called when DownloadController Java object is instantiated. |
| 52 void Init(JNIEnv* env, jobject obj); | 52 void Init(JNIEnv* env, jobject obj); |
| 53 | 53 |
| 54 // Removes a deferred download from |deferred_downloads_|. | 54 // Removes a deferred download from |deferred_downloads_|. |
| 55 void CancelDeferredDownload(DeferredDownloadObserver* observer); | 55 void CancelDeferredDownload(DeferredDownloadObserver* observer); |
| 56 | 56 |
| 57 // DownloadControllerAndroid implementation. | 57 // DownloadControllerAndroid implementation. |
| 58 void AcquireFileAccessPermission( | 58 void AcquireFileAccessPermission( |
| 59 int render_process_id, | 59 WebContents* web_contents, |
| 60 int render_view_id, | |
| 61 const AcquireFileAccessPermissionCallback& callback) override; | 60 const AcquireFileAccessPermissionCallback& callback) override; |
| 62 | 61 |
| 63 private: | 62 private: |
| 64 // Used to store all the information about an Android download. | 63 // Used to store all the information about an Android download. |
| 65 struct DownloadInfoAndroid { | 64 struct DownloadInfoAndroid { |
| 66 explicit DownloadInfoAndroid(net::URLRequest* request); | 65 explicit DownloadInfoAndroid(net::URLRequest* request); |
| 67 ~DownloadInfoAndroid(); | 66 ~DownloadInfoAndroid(); |
| 68 | 67 |
| 69 // The URL from which we are downloading. This is the final URL after any | 68 // The URL from which we are downloading. This is the final URL after any |
| 70 // redirection by the server for |original_url_|. | 69 // redirection by the server for |original_url_|. |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 JavaObject* java_object_; | 142 JavaObject* java_object_; |
| 144 | 143 |
| 145 ScopedVector<DeferredDownloadObserver> deferred_downloads_; | 144 ScopedVector<DeferredDownloadObserver> deferred_downloads_; |
| 146 | 145 |
| 147 DISALLOW_COPY_AND_ASSIGN(DownloadControllerAndroidImpl); | 146 DISALLOW_COPY_AND_ASSIGN(DownloadControllerAndroidImpl); |
| 148 }; | 147 }; |
| 149 | 148 |
| 150 } // namespace content | 149 } // namespace content |
| 151 | 150 |
| 152 #endif // CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_IMPL_H_ | 151 #endif // CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_IMPL_H_ |
| OLD | NEW |