Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Issue 10704052: Download filename determination refactor (3/3) (Closed)

Created:
8 years, 5 months ago by asanka
Modified:
8 years, 5 months ago
CC:
chromium-reviews, sky, Miranda Callahan
Visibility:
Public.

Description

Download filename determination refactor (3/3) Move prompting logic from content/ to chrome/. When determining the target path for a download, we used to notify content/ of what the target path was along with a flag indicating whether the user should be prompted. Then DownloadManager would call into the DownloadManagerDelegate to request a prompt if necessary. This patch short circuits the logic so that the DownloadManagerDelegate would prompt the user as necessary and only pass the final path to the DownloadItem. BUG=78085 TEST=unit tests TBR=sky,mirandac Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=148703

Patch Set 1 : #

Total comments: 14

Patch Set 2 : Use a callback with DetermineDownloadTarget(). #

Total comments: 12

Patch Set 3 : BrowsingDataRemover calls CDMD directly #

Total comments: 11

Patch Set 4 : Address comments and rework tests #

Patch Set 5 : Merge with r147256 #

Total comments: 5

Patch Set 6 : Address comments #

Total comments: 7

Patch Set 7 : Remove content:: from code that's already in content namespace #

Patch Set 8 : Merge with r148321 #

Patch Set 9 : Fix test #

Patch Set 10 : Merge with r148594 to and resolve conflicts with r148576 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+820 lines, -772 lines) Patch
M chrome/browser/browsing_data/browsing_data_remover.cc View 1 2 3 4 5 6 7 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/download/chrome_download_manager_delegate.h View 1 2 3 4 5 6 7 8 chunks +50 lines, -10 lines 0 comments Download
M chrome/browser/download/chrome_download_manager_delegate.cc View 1 2 3 4 5 6 7 11 chunks +85 lines, -41 lines 0 comments Download
M chrome/browser/download/chrome_download_manager_delegate_unittest.cc View 1 2 3 30 chunks +165 lines, -82 lines 0 comments Download
M chrome/browser/download/download_browsertest.cc View 1 2 3 4 5 6 7 8 9 49 chunks +50 lines, -86 lines 0 comments Download
M chrome/browser/download/download_file_picker.h View 1 2 3 4 3 chunks +16 lines, -3 lines 0 comments Download
M chrome/browser/download/download_file_picker.cc View 1 2 3 3 chunks +19 lines, -12 lines 0 comments Download
M chrome/browser/download/download_file_picker_chromeos.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/download/download_file_picker_chromeos.cc View 1 2 3 4 5 6 7 8 9 3 chunks +12 lines, -17 lines 0 comments Download
M chrome/browser/download/download_service.h View 1 2 3 4 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/download/download_service.cc View 1 2 3 4 5 6 7 8 3 chunks +22 lines, -12 lines 0 comments Download
M chrome/browser/download/download_status_updater.h View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/download/download_status_updater.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/download/download_test_observer.h View 1 2 3 4 5 7 chunks +33 lines, -20 lines 0 comments Download
M chrome/browser/download/download_test_observer.cc View 1 2 3 4 5 6 7 8 9 8 chunks +70 lines, -19 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api_unittest.cc View 1 2 3 4 5 6 7 8 9 5 chunks +8 lines, -7 lines 0 comments Download
M chrome/browser/extensions/crx_installer_browsertest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/profiles/off_the_record_profile_impl.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/browser_close_browsertest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +7 lines, -2 lines 0 comments Download
M content/browser/download/download_item_impl.h View 1 2 3 4 5 chunks +14 lines, -11 lines 0 comments Download
M content/browser/download/download_item_impl.cc View 1 2 3 4 5 6 7 8 9 6 chunks +39 lines, -32 lines 0 comments Download
M content/browser/download/download_item_impl_delegate.h View 1 2 3 4 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/download/download_item_impl_delegate.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/download/download_item_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 13 chunks +55 lines, -75 lines 0 comments Download
M content/browser/download/download_manager_impl.h View 1 2 3 4 5 chunks +11 lines, -14 lines 0 comments Download
M content/browser/download/download_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 chunks +49 lines, -109 lines 0 comments Download
M content/browser/download/download_manager_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 8 chunks +10 lines, -69 lines 0 comments Download
M content/public/browser/download_item.h View 1 2 3 4 5 6 3 chunks +1 line, -22 lines 0 comments Download
M content/public/browser/download_manager.h View 1 2 3 4 5 6 7 8 9 3 chunks +2 lines, -21 lines 0 comments Download
M content/public/browser/download_manager_delegate.h View 1 2 3 4 5 6 3 chunks +30 lines, -19 lines 0 comments Download
M content/public/browser/download_manager_delegate.cc View 1 2 3 4 5 6 1 chunk +4 lines, -7 lines 0 comments Download
M content/public/test/mock_download_item.h View 1 2 3 4 5 6 4 chunks +10 lines, -16 lines 0 comments Download
M content/public/test/mock_download_manager.h View 1 2 3 4 5 6 4 chunks +14 lines, -22 lines 0 comments Download
M content/shell/shell_download_manager_delegate.h View 1 2 3 4 2 chunks +7 lines, -4 lines 0 comments Download
M content/shell/shell_download_manager_delegate.cc View 1 2 3 4 5 6 7 4 chunks +17 lines, -28 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
asanka
Can you take a high level look at where this is going? It doesn't have ...
8 years, 5 months ago (2012-07-03 21:33:19 UTC) #1
Randy Smith (Not in Mondays)
This was a very high level review (which means in this case that I looked ...
8 years, 5 months ago (2012-07-05 15:42:32 UTC) #2
asanka
http://codereview.chromium.org/10704052/diff/1022/chrome/browser/browsing_data_remover.cc File chrome/browser/browsing_data_remover.cc (right): http://codereview.chromium.org/10704052/diff/1022/chrome/browser/browsing_data_remover.cc#newcode297 chrome/browser/browsing_data_remover.cc:297: download_manager->ClearTransientState(); On 2012/07/05 15:42:32, rdsmith wrote: > Given that ...
8 years, 5 months ago (2012-07-09 21:13:46 UTC) #3
Randy Smith (Not in Mondays)
Basic approach looks good to me, modulo the ClearTransientState() plumbing. Let me know when you'd ...
8 years, 5 months ago (2012-07-10 18:33:09 UTC) #4
Randy Smith (Not in Mondays)
Oh, just for reference, I'm probably not a good reviewer for the chromeos file picker.
8 years, 5 months ago (2012-07-10 18:33:54 UTC) #5
asanka
http://codereview.chromium.org/10704052/diff/1022/chrome/browser/browsing_data_remover.cc File chrome/browser/browsing_data_remover.cc (right): http://codereview.chromium.org/10704052/diff/1022/chrome/browser/browsing_data_remover.cc#newcode297 chrome/browser/browsing_data_remover.cc:297: download_manager->ClearTransientState(); On 2012/07/10 18:33:09, rdsmith wrote: > On 2012/07/09 ...
8 years, 5 months ago (2012-07-11 20:03:32 UTC) #6
Randy Smith (Not in Mondays)
[Added John to cc list for question. ] On 2012/07/11 20:03:32, asanka wrote: http://codereview.chromium.org/10704052/diff/1022/chrome/browser/browsing_data_remover.cc#newcode297 > ...
8 years, 5 months ago (2012-07-12 16:35:37 UTC) #7
Randy Smith (Not in Mondays)
This looks pretty good. One more general question: I would have thought that we'd have ...
8 years, 5 months ago (2012-07-12 17:01:22 UTC) #8
asanka
http://codereview.chromium.org/10704052/diff/7005/chrome/browser/browsing_data_remover.cc File chrome/browser/browsing_data_remover.cc (right): http://codereview.chromium.org/10704052/diff/7005/chrome/browser/browsing_data_remover.cc#newcode302 chrome/browser/browsing_data_remover.cc:302: download_service->GetDownloadManagerDelegate()); On 2012/07/12 17:01:22, rdsmith wrote: > On 2012/07/11 ...
8 years, 5 months ago (2012-07-18 21:50:55 UTC) #9
asanka
Randy: The test reworking added some non-trivial changes. Can you take a look at the ...
8 years, 5 months ago (2012-07-18 21:58:45 UTC) #10
Randy Smith (Not in Mondays)
http://codereview.chromium.org/10704052/diff/29001/chrome/browser/download/download_test_observer.h File chrome/browser/download/download_test_observer.h (right): http://codereview.chromium.org/10704052/diff/29001/chrome/browser/download/download_test_observer.h#newcode18 chrome/browser/download/download_test_observer.h:18: namespace internal { Where does the "namespace internal" pattern ...
8 years, 5 months ago (2012-07-19 18:14:57 UTC) #11
asanka
http://codereview.chromium.org/10704052/diff/29001/chrome/browser/download/download_test_observer.h File chrome/browser/download/download_test_observer.h (right): http://codereview.chromium.org/10704052/diff/29001/chrome/browser/download/download_test_observer.h#newcode18 chrome/browser/download/download_test_observer.h:18: namespace internal { On 2012/07/19 18:14:57, rdsmith wrote: > ...
8 years, 5 months ago (2012-07-23 19:47:10 UTC) #12
Randy Smith (Not in Mondays)
LGTM, but do specifically run the browser closer tests (with --gtest_also_run_disabled_tests) since they're mostly disabled ...
8 years, 5 months ago (2012-07-24 15:32:27 UTC) #13
asanka
achuith: Can you take a look at the download_file_picker_chromeos.* changes? In addition, once this goes ...
8 years, 5 months ago (2012-07-24 19:46:03 UTC) #14
jam
lgtm http://codereview.chromium.org/10704052/diff/31005/content/public/browser/download_manager_delegate.cc File content/public/browser/download_manager_delegate.cc (right): http://codereview.chromium.org/10704052/diff/31005/content/public/browser/download_manager_delegate.cc#newcode18 content/public/browser/download_manager_delegate.cc:18: const content::DownloadTargetCallback& callback) { ditto http://codereview.chromium.org/10704052/diff/31005/content/public/browser/download_manager_delegate.h File content/public/browser/download_manager_delegate.h ...
8 years, 5 months ago (2012-07-24 20:41:16 UTC) #15
asanka
Thanks! http://codereview.chromium.org/10704052/diff/31005/content/public/browser/download_manager_delegate.cc File content/public/browser/download_manager_delegate.cc (right): http://codereview.chromium.org/10704052/diff/31005/content/public/browser/download_manager_delegate.cc#newcode18 content/public/browser/download_manager_delegate.cc:18: const content::DownloadTargetCallback& callback) { On 2012/07/24 20:41:16, John ...
8 years, 5 months ago (2012-07-24 21:21:28 UTC) #16
achuithb
lgtm. Sorry for the delay
8 years, 5 months ago (2012-07-26 00:20:06 UTC) #17
asanka
On 2012/07/26 00:20:06, achuith.bhandarkar wrote: > lgtm. > > Sorry for the delay Thanks! Added ...
8 years, 5 months ago (2012-07-26 16:20:39 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/10704052/53001
8 years, 5 months ago (2012-07-26 16:24:03 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/10704052/59001
8 years, 5 months ago (2012-07-27 01:11:01 UTC) #20
commit-bot: I haz the power
8 years, 5 months ago (2012-07-27 02:31:24 UTC) #21
Change committed as 148703

Powered by Google App Engine
This is Rietveld 408576698