Chromium Code Reviews| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 WebContents* web_contents; | 84 WebContents* web_contents; |
| 85 // Default copy constructor is used for passing this struct by value. | 85 // Default copy constructor is used for passing this struct by value. |
| 86 }; | 86 }; |
| 87 struct JavaObject; | 87 struct JavaObject; |
| 88 friend struct base::DefaultSingletonTraits<DownloadControllerAndroidImpl>; | 88 friend struct base::DefaultSingletonTraits<DownloadControllerAndroidImpl>; |
| 89 DownloadControllerAndroidImpl(); | 89 DownloadControllerAndroidImpl(); |
| 90 ~DownloadControllerAndroidImpl() override; | 90 ~DownloadControllerAndroidImpl() override; |
| 91 | 91 |
| 92 // Helper method for implementing AcquireFileAccessPermission(). | 92 // Helper method for implementing AcquireFileAccessPermission(). |
| 93 bool HasFileAccessPermission( | 93 bool HasFileAccessPermission( |
| 94 base::android::ScopedJavaLocalRef<jobject> j_content_view_core); | 94 base::android::ScopedJavaLocalRef<jobject> jwindow_android); |
| 95 | 95 |
| 96 // DownloadControllerAndroid implementation. | 96 // DownloadControllerAndroid implementation. |
| 97 void CreateGETDownload(int render_process_id, | 97 void CreateGETDownload(int render_process_id, |
| 98 int render_view_id, | 98 int render_view_id, |
| 99 int request_id, | 99 int request_id, |
| 100 bool must_download) override; | 100 bool must_download) override; |
| 101 void OnDownloadStarted(DownloadItem* download_item) override; | 101 void OnDownloadStarted(DownloadItem* download_item) override; |
| 102 void StartContextMenuDownload(const ContextMenuParams& params, | 102 void StartContextMenuDownload(const ContextMenuParams& params, |
| 103 WebContents* web_contents, | 103 WebContents* web_contents, |
| 104 bool is_link, | 104 bool is_link, |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 135 bool must_download, | 135 bool must_download, |
| 136 const DownloadInfoAndroid& info, | 136 const DownloadInfoAndroid& info, |
| 137 bool allowed); | 137 bool allowed); |
| 138 | 138 |
| 139 // The download item contains dangerous file types. | 139 // The download item contains dangerous file types. |
| 140 void OnDangerousDownload(DownloadItem *item); | 140 void OnDangerousDownload(DownloadItem *item); |
| 141 | 141 |
| 142 base::android::ScopedJavaLocalRef<jobject> GetContentViewCoreFromWebContents( | 142 base::android::ScopedJavaLocalRef<jobject> GetContentViewCoreFromWebContents( |
| 143 WebContents* web_contents); | 143 WebContents* web_contents); |
| 144 | 144 |
| 145 base::android::ScopedJavaLocalRef<jobject> GetJavWebContents( | |
|
no sievers
2016/05/27 19:09:25
typo... but actually it's unused
Jinsuk Kim
2016/05/30 01:20:57
Removed.
| |
| 146 WebContents* web_contents); | |
| 147 | |
| 145 // Creates Java object if it is not created already and returns it. | 148 // Creates Java object if it is not created already and returns it. |
| 146 JavaObject* GetJavaObject(); | 149 JavaObject* GetJavaObject(); |
| 147 | 150 |
| 148 JavaObject* java_object_; | 151 JavaObject* java_object_; |
| 149 | 152 |
| 150 std::string default_file_name_; | 153 std::string default_file_name_; |
| 151 | 154 |
| 152 ScopedVector<DeferredDownloadObserver> deferred_downloads_; | 155 ScopedVector<DeferredDownloadObserver> deferred_downloads_; |
| 153 | 156 |
| 154 DISALLOW_COPY_AND_ASSIGN(DownloadControllerAndroidImpl); | 157 DISALLOW_COPY_AND_ASSIGN(DownloadControllerAndroidImpl); |
| 155 }; | 158 }; |
| 156 | 159 |
| 157 } // namespace content | 160 } // namespace content |
| 158 | 161 |
| 159 #endif // CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_IMPL_H_ | 162 #endif // CONTENT_BROWSER_ANDROID_DOWNLOAD_CONTROLLER_ANDROID_IMPL_H_ |
| OLD | NEW |