Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: chrome/browser/android/download/download_manager_service.h

Issue 2332213002: [Download Home] Properly enqueue download requests (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/android/download/download_manager_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/download/download_manager_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698