| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 // UMA histogram enum for download cancellation reasons. Keep this | 53 // UMA histogram enum for download cancellation reasons. Keep this |
| 54 // in sync with MobileDownloadCancelReason in histograms.xml. This should be | 54 // in sync with MobileDownloadCancelReason in histograms.xml. This should be |
| 55 // append only. | 55 // append only. |
| 56 enum DownloadCancelReason { | 56 enum DownloadCancelReason { |
| 57 CANCEL_REASON_NOT_CANCELED = 0, | 57 CANCEL_REASON_NOT_CANCELED = 0, |
| 58 CANCEL_REASON_ACTION_BUTTON, | 58 CANCEL_REASON_ACTION_BUTTON, |
| 59 CANCEL_REASON_NOTIFICATION_DISMISSED, | 59 CANCEL_REASON_NOTIFICATION_DISMISSED, |
| 60 CANCEL_REASON_OVERWRITE_INFOBAR_DISMISSED, | 60 CANCEL_REASON_OVERWRITE_INFOBAR_DISMISSED, |
| 61 CANCEL_REASON_NO_STORAGE_PERMISSION, | 61 CANCEL_REASON_NO_STORAGE_PERMISSION, |
| 62 CANCEL_REASON_DANGEROUS_INFOBAR_DISMISSED, |
| 62 CANCEL_REASON_MAX | 63 CANCEL_REASON_MAX |
| 63 }; | 64 }; |
| 64 static void RecordDownloadCancelReason(DownloadCancelReason reason); | 65 static void RecordDownloadCancelReason(DownloadCancelReason reason); |
| 65 | 66 |
| 66 private: | 67 private: |
| 67 struct JavaObject; | 68 struct JavaObject; |
| 68 friend struct base::DefaultSingletonTraits<DownloadController>; | 69 friend struct base::DefaultSingletonTraits<DownloadController>; |
| 69 DownloadController(); | 70 DownloadController(); |
| 70 ~DownloadController() override; | 71 ~DownloadController() override; |
| 71 | 72 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 JavaObject* GetJavaObject(); | 110 JavaObject* GetJavaObject(); |
| 110 | 111 |
| 111 JavaObject* java_object_; | 112 JavaObject* java_object_; |
| 112 | 113 |
| 113 std::string default_file_name_; | 114 std::string default_file_name_; |
| 114 | 115 |
| 115 DISALLOW_COPY_AND_ASSIGN(DownloadController); | 116 DISALLOW_COPY_AND_ASSIGN(DownloadController); |
| 116 }; | 117 }; |
| 117 | 118 |
| 118 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_H_ | 119 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_CONTROLLER_H_ |
| OLD | NEW |