| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 static bool RegisterDownloadController(JNIEnv* env); | 42 static bool RegisterDownloadController(JNIEnv* env); |
| 43 | 43 |
| 44 // Called when DownloadController Java object is instantiated. | 44 // Called when DownloadController Java object is instantiated. |
| 45 void Init(JNIEnv* env, jobject obj); | 45 void Init(JNIEnv* env, jobject obj); |
| 46 | 46 |
| 47 // DownloadControllerBase implementation. | 47 // DownloadControllerBase implementation. |
| 48 void AcquireFileAccessPermission( | 48 void AcquireFileAccessPermission( |
| 49 content::WebContents* web_contents, | 49 content::WebContents* web_contents, |
| 50 const AcquireFileAccessPermissionCallback& callback) override; | 50 const AcquireFileAccessPermissionCallback& callback) override; |
| 51 void SetDefaultDownloadFileName(const std::string& file_name) override; | |
| 52 | 51 |
| 53 // UMA histogram enum for download cancellation reasons. Keep this | 52 // UMA histogram enum for download cancellation reasons. Keep this |
| 54 // in sync with MobileDownloadCancelReason in histograms.xml. This should be | 53 // in sync with MobileDownloadCancelReason in histograms.xml. This should be |
| 55 // append only. | 54 // append only. |
| 56 enum DownloadCancelReason { | 55 enum DownloadCancelReason { |
| 57 CANCEL_REASON_NOT_CANCELED = 0, | 56 CANCEL_REASON_NOT_CANCELED = 0, |
| 58 CANCEL_REASON_ACTION_BUTTON, | 57 CANCEL_REASON_ACTION_BUTTON, |
| 59 CANCEL_REASON_NOTIFICATION_DISMISSED, | 58 CANCEL_REASON_NOTIFICATION_DISMISSED, |
| 60 CANCEL_REASON_OVERWRITE_INFOBAR_DISMISSED, | 59 CANCEL_REASON_OVERWRITE_INFOBAR_DISMISSED, |
| 61 CANCEL_REASON_NO_STORAGE_PERMISSION, | 60 CANCEL_REASON_NO_STORAGE_PERMISSION, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 JavaObject* GetJavaObject(); | 97 JavaObject* GetJavaObject(); |
| 99 | 98 |
| 100 JavaObject* java_object_; | 99 JavaObject* java_object_; |
| 101 | 100 |
| 102 std::string default_file_name_; | 101 std::string default_file_name_; |
| 103 | 102 |
| 104 DISALLOW_COPY_AND_ASSIGN(DownloadController); | 103 DISALLOW_COPY_AND_ASSIGN(DownloadController); |
| 105 }; | 104 }; |
| 106 | 105 |
| 107 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_H_ | 106 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_H_ |
| OLD | NEW |