OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MANAGER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MANAGER_SERVICE_H_ |
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MANAGER_SERVICE_H_ | 6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MANAGER_SERVICE_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 typedef base::Callback<void(bool)> ResumeCallback; | 123 typedef base::Callback<void(bool)> ResumeCallback; |
124 void set_resume_callback_for_testing(const ResumeCallback& resume_cb) { | 124 void set_resume_callback_for_testing(const ResumeCallback& resume_cb) { |
125 resume_callback_for_testing_ = resume_cb; | 125 resume_callback_for_testing_ = resume_cb; |
126 } | 126 } |
127 | 127 |
128 // Reference to the Java object. | 128 // Reference to the Java object. |
129 base::android::ScopedJavaGlobalRef<jobject> java_ref_; | 129 base::android::ScopedJavaGlobalRef<jobject> java_ref_; |
130 | 130 |
131 bool is_history_query_complete_; | 131 bool is_history_query_complete_; |
132 | 132 |
| 133 enum PendingGetDownloadsFlags { |
| 134 NONE = 0, |
| 135 REGULAR = 1 << 0, |
| 136 OFF_THE_RECORD = 1 << 1, |
| 137 }; |
| 138 int pending_get_downloads_actions_; |
| 139 |
133 enum DownloadAction { | 140 enum DownloadAction { |
134 RESUME, | 141 RESUME, |
135 PAUSE, | 142 PAUSE, |
136 CANCEL, | 143 CANCEL, |
137 REMOVE, | 144 REMOVE, |
138 INITIALIZE_UI, | 145 UNKNOWN |
139 INITIALIZE_OFF_THE_RECORD_UI, | 146 }; |
140 UNKNOWN }; | |
141 | |
142 using PendingDownloadActions = std::map<std::string, DownloadAction>; | 147 using PendingDownloadActions = std::map<std::string, DownloadAction>; |
143 PendingDownloadActions pending_actions_; | 148 PendingDownloadActions pending_actions_; |
144 | 149 |
145 void EnqueueDownloadAction(const std::string& download_guid, | 150 void EnqueueDownloadAction(const std::string& download_guid, |
146 DownloadAction action); | 151 DownloadAction action); |
147 | 152 |
148 ResumeCallback resume_callback_for_testing_; | 153 ResumeCallback resume_callback_for_testing_; |
149 | 154 |
150 std::unique_ptr<AllDownloadItemNotifier> original_notifier_; | 155 std::unique_ptr<AllDownloadItemNotifier> original_notifier_; |
151 std::unique_ptr<AllDownloadItemNotifier> off_the_record_notifier_; | 156 std::unique_ptr<AllDownloadItemNotifier> off_the_record_notifier_; |
152 | 157 |
153 DISALLOW_COPY_AND_ASSIGN(DownloadManagerService); | 158 DISALLOW_COPY_AND_ASSIGN(DownloadManagerService); |
154 }; | 159 }; |
155 | 160 |
156 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MANAGER_SERVICE_H_ | 161 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_MANAGER_SERVICE_H_ |
OLD | NEW |