|
[downloads] Move platform specific code out of DownloadTargetDeterminer.
This CL cleans up the download target determination logic so that:
* DownloadTargetDeterminer provides a reason for requesting user
confirmation for a download path.
The caller can thus use platform specific logic to handle the
confirmation request. Chromium on Android doesn't always prompt the
user for a download location, and hence needs to know *why* a
confirmation is requested in order to decide how to proceed.
* DownloadTargetDeterminer allows the caller to return a finer grained
result than a boolean following a confirmation request.
Just knowing whether the user confirmed or rejected is insufficient.
On Android, for example, there are cases where the platform specific
code will automatically accept a confirmation request raised by the
DownloadTargetDeterminer. In such cases, it is important to note
whether the result indicates explicit user consent or not, which is a
signal used elsewhere for determining download security.
* DownloadPathReservationTracker provides a detailed result after
completing target determination.
The extra detail allows DownloadTargetDeterminer to indicate *why*
the target determination failed rather than just the fact that it
failed. This result can then be translated to an interrupt reason.
* DownloadItem accepts an interrupt reason during download target
determination.
More things can go wrong during this stage of the download than user
cancellation.
Consequently, the download target conflict resolution logic can now be
moved entirely into ChromeDownloadManagerDelegate. Previously the logic
was split between DownloadTargetDeterminer,
DownloadPathReservationTracker, and ChromeDownloadManagerDelegate on
Android.
BUG= 334474
Total comments: 32
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+1918 lines, -1229 lines) |
Patch |
|
M |
android_webview/browser/aw_download_manager_delegate.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/BUILD.gn
|
View
|
1
2
3
|
2 chunks |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.h
|
View
|
1
2
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.cc
|
View
|
1
2
3
|
4 chunks |
+10 lines, -8 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/chrome_download_manager_delegate.h
|
View
|
1
2
|
4 chunks |
+13 lines, -7 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/chrome_download_manager_delegate.cc
|
View
|
1
2
3
|
6 chunks |
+69 lines, -18 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/chrome_download_manager_delegate_unittest.cc
|
View
|
1
2
3
|
17 chunks |
+292 lines, -75 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_browsertest.cc
|
View
|
1
2
|
5 chunks |
+20 lines, -10 lines |
0 comments
|
Download
|
|
A |
chrome/browser/download/download_confirmation_reason.h
|
View
|
1
2
|
1 chunk |
+36 lines, -0 lines |
0 comments
|
Download
|
|
A |
chrome/browser/download/download_confirmation_result.h
|
View
|
1
2
|
1 chunk |
+28 lines, -0 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_file_picker.h
|
View
|
1
2
|
3 chunks |
+7 lines, -5 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_file_picker.cc
|
View
|
1
2
|
3 chunks |
+8 lines, -6 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_path_reservation_tracker.h
|
View
|
1
2
3
|
2 chunks |
+11 lines, -4 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_path_reservation_tracker.cc
|
View
|
1
2
3
|
8 chunks |
+121 lines, -98 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_path_reservation_tracker_unittest.cc
|
View
|
1
2
3
|
25 chunks |
+126 lines, -179 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_target_determiner.h
|
View
|
1
2
3
|
8 chunks |
+30 lines, -20 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_target_determiner.cc
|
View
|
1
2
3
|
17 chunks |
+117 lines, -122 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_target_determiner_delegate.h
|
View
|
1
2
3
|
4 chunks |
+16 lines, -14 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_target_determiner_unittest.cc
|
View
|
1
2
3
|
57 chunks |
+575 lines, -436 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_target_info.h
|
View
|
1
2
3
|
3 chunks |
+8 lines, -0 lines |
0 comments
|
Download
|
|
A |
chrome/browser/download/download_target_info.cc
|
View
|
1
2
3
|
1 chunk |
+16 lines, -0 lines |
0 comments
|
Download
|
|
M |
chrome/browser/download/download_test_file_activity_observer.cc
|
View
|
1
2
|
1 chunk |
+9 lines, -7 lines |
0 comments
|
Download
|
|
M |
chrome/browser/lifetime/browser_close_manager_browsertest.cc
|
View
|
1
2
|
1 chunk |
+8 lines, -10 lines |
0 comments
|
Download
|
|
M |
chromecast/browser/cast_download_manager_delegate.cc
|
View
|
|
3 chunks |
+5 lines, -6 lines |
0 comments
|
Download
|
|
M |
content/browser/download/download_item_impl.h
|
View
|
1
2
|
3 chunks |
+10 lines, -5 lines |
0 comments
|
Download
|
|
M |
content/browser/download/download_item_impl.cc
|
View
|
1
2
|
22 chunks |
+120 lines, -87 lines |
0 comments
|
Download
|
|
M |
content/browser/download/download_item_impl_delegate.h
|
View
|
1
2
|
2 chunks |
+7 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/browser/download/download_item_impl_delegate.cc
|
View
|
|
1 chunk |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
content/browser/download/download_item_impl_unittest.cc
|
View
|
1
2
|
37 chunks |
+196 lines, -75 lines |
0 comments
|
Download
|
|
M |
content/browser/download/download_manager_impl.cc
|
View
|
1
2
|
1 chunk |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
content/browser/download/download_manager_impl_unittest.cc
|
View
|
1
2
|
6 chunks |
+11 lines, -5 lines |
0 comments
|
Download
|
|
M |
content/browser/download/mock_download_item_impl.h
|
View
|
1
2
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
content/public/browser/download_manager_delegate.h
|
View
|
|
1 chunk |
+26 lines, -11 lines |
0 comments
|
Download
|
|
M |
content/shell/browser/shell_download_manager_delegate.cc
|
View
|
1
2
|
4 chunks |
+6 lines, -4 lines |
0 comments
|
Download
|
Total messages: 71 (65 generated)
|