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

Issue 6905049: Detect removed files and reflect the state in chrome://downloads and the download shelf (Closed)

Created:
9 years, 8 months ago by haraken1
Modified:
9 years, 6 months ago
CC:
chromium-reviews, arv (Not doing code reviews), rdsmith+dwatch_chromium.org
Visibility:
Public.

Description

Detect removed files and reflect the state in chrome://downloads and the download shelf - Invalidate the links of removed files in chrome://downloads page - Label "Removed" for the removed files in the download shelf BUG=29093 TEST=Observe that in chrome://downloads, the downloaded and then removed files are labeled "Removed" and have no links, Observe that in the download shelf, the downloaded and then removed files are labeled "Removed", DownloadManagerTest.* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=89148

Patch Set 1 #

Total comments: 4

Patch Set 2 : Use ternary operator, Insert NOTIMPLEMENTED(), Change the description of "Removed" #

Total comments: 2

Patch Set 3 : Add |is_path_exists| to DownloadItem, which manages whether the path still exists or not #

Patch Set 4 : Correct typos #

Total comments: 5

Patch Set 5 : is_path_exists_ => file_exists_, aggregate scattered AddObserver()s into one AddObserver() #

Total comments: 8

Patch Set 6 : Show "Removed" label on the download shelf, Add DownloadManagerTest.DownloadRemoveTest, misc #

Patch Set 7 : Correct typo #

Total comments: 25

Patch Set 8 : Detect removed files whenever a user takes an action in chrome://downloads or the download shelf #

Patch Set 9 : Move CheckForFilesRemoval() from DownloadShelfGtk to Browser #

Patch Set 10 : Correct typo #

Total comments: 11

Patch Set 11 : Use a FIFO array to avoid the race of updates of a download state, Reduce probe points #

Patch Set 12 : Correct typo #

Total comments: 13

Patch Set 13 : Change probe points, Add DownloadItem::CanShowInFolder() #

Patch Set 14 : Change !file_externally_removed() to !file_externally_removed_ in download_item.cc #

Patch Set 15 : Reflect the "Removed" status to the download shelf #

Total comments: 5

Patch Set 16 : Remove REMOVED state from Download.States in downloads.js #

Total comments: 6

Patch Set 17 : Check |file_externally_removed_| at DownloadItem::CanOpenDownload() #

Total comments: 6

Patch Set 18 : Add a cocoa animation when the download shelf is labeled as "Removed" #

Total comments: 4

Patch Set 19 : Merge with the latest revision #

Unified diffs Side-by-side diffs Delta from patch set Stats (+348 lines, -72 lines) Patch
M chrome/app/generated_resources.grd View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +9 lines, -2 lines 0 comments Download
M chrome/browser/download/download_item.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +15 lines, -4 lines 0 comments Download
M chrome/browser/download/download_item.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +20 lines, -2 lines 0 comments Download
M chrome/browser/download/download_item_model.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -1 line 0 comments Download
M chrome/browser/download/download_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +18 lines, -0 lines 0 comments Download
M chrome/browser/download/download_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +43 lines, -0 lines 0 comments Download
M chrome/browser/download/download_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 12 chunks +128 lines, -3 lines 0 comments Download
M chrome/browser/download/download_shelf_context_menu.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/download/download_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/resources/downloads.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 8 chunks +38 lines, -8 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_cell.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_cell.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 7 chunks +29 lines, -2 lines 0 comments Download
M chrome/browser/ui/gtk/download/download_item_gtk.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/gtk/download/download_item_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +26 lines, -27 lines 0 comments Download
M chrome/browser/ui/views/download/download_item_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ui/views/download/download_item_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 5 chunks +3 lines, -8 lines 0 comments Download
M chrome/browser/ui/webui/downloads_dom_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +4 lines, -10 lines 0 comments Download
M chrome/browser/ui/webui/downloads_ui.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 63 (0 generated)
haraken1
I am trying to fix the bug 29093. I fixed so that the downloaded but ...
9 years, 8 months ago (2011-04-27 01:53:52 UTC) #1
Paweł Hajdan Jr.
Drive-by with download comments. http://codereview.chromium.org/6905049/diff/1/chrome/browser/download/download_util.cc File chrome/browser/download/download_util.cc (right): http://codereview.chromium.org/6905049/diff/1/chrome/browser/download/download_util.cc#newcode667 chrome/browser/download/download_util.cc:667: bool path_exists = true; It ...
9 years, 8 months ago (2011-04-27 08:53:30 UTC) #2
ahendrickson
Added mmenke as a reviewer for chrome/app/generated_resources.grd
9 years, 8 months ago (2011-04-27 15:37:47 UTC) #3
mmenke
http://codereview.chromium.org/6905049/diff/1/chrome/app/generated_resources.grd File chrome/app/generated_resources.grd (right): http://codereview.chromium.org/6905049/diff/1/chrome/app/generated_resources.grd#newcode2214 chrome/app/generated_resources.grd:2214: desc="Remove link text"> I know you're just following the ...
9 years, 8 months ago (2011-04-27 16:02:10 UTC) #4
ahendrickson
You also need to update the download item on the download shelf. That's going to ...
9 years, 8 months ago (2011-04-27 17:30:56 UTC) #5
haraken1
> http://codereview.chromium.org/6905049/diff/1/chrome/browser/download/download_util.cc > File chrome/browser/download/download_util.cc (right): > > http://codereview.chromium.org/6905049/diff/1/chrome/browser/download/download_util.cc#newcode667 > chrome/browser/download/download_util.cc:667: bool path_exists = true; ...
9 years, 8 months ago (2011-04-27 17:44:35 UTC) #6
haraken1
> http://codereview.chromium.org/6905049/diff/1/chrome/app/generated_resources.grd > File chrome/app/generated_resources.grd (right): > > http://codereview.chromium.org/6905049/diff/1/chrome/app/generated_resources.grd#newcode2214 > chrome/app/generated_resources.grd:2214: desc="Remove link text"> > ...
9 years, 8 months ago (2011-04-27 17:45:26 UTC) #7
haraken1
> You also need to update the download item on the download shelf. > That's ...
9 years, 8 months ago (2011-04-27 17:46:18 UTC) #8
Randy Smith (Not in Mondays)
I'm afraid I have some intrusive drive-by comments. First of all, keep in mind that ...
9 years, 8 months ago (2011-04-27 18:21:21 UTC) #9
mmenke
On 2011/04/27 17:44:35, haraken wrote: > > > http://codereview.chromium.org/6905049/diff/1/chrome/browser/download/download_util.cc > > File chrome/browser/download/download_util.cc (right): > ...
9 years, 8 months ago (2011-04-27 18:25:08 UTC) #10
mmenke
I defer to Randy on this issue.
9 years, 8 months ago (2011-04-27 18:29:31 UTC) #11
Avi (use Gerrit)
On 2011/04/27 17:44:35, haraken wrote: > I first thought it but didn't because the functions ...
9 years, 8 months ago (2011-04-27 18:35:42 UTC) #12
mmenke
On 2011/04/27 18:21:21, rdsmith wrote: > More generally, what's your motivation for this change? While ...
9 years, 8 months ago (2011-04-27 19:13:23 UTC) #13
Randy Smith (Not in Mondays)
On 2011/04/27 19:13:23, Matt Menke wrote: > While I can't speak to haraken's motivation, or ...
9 years, 8 months ago (2011-04-27 20:06:08 UTC) #14
mmenke
On 2011/04/27 20:06:08, rdsmith wrote: > That makes a great deal of sense to me. ...
9 years, 8 months ago (2011-04-27 20:20:24 UTC) #15
haraken1
Randy wrote: >> Looking at the bug, my inclination would be to change the thrust ...
9 years, 8 months ago (2011-04-27 23:11:14 UTC) #16
Paweł Hajdan Jr.
http://codereview.chromium.org/6905049/diff/1006/chrome/browser/download/download_util.cc File chrome/browser/download/download_util.cc (right): http://codereview.chromium.org/6905049/diff/1006/chrome/browser/download/download_util.cc#newcode679 chrome/browser/download/download_util.cc:679: file_value->SetString("state", path_exists ? "COMPLETE" : "REMOVED"); On 2011/04/27 18:21:21, ...
9 years, 8 months ago (2011-04-29 08:43:41 UTC) #17
haraken1
Thank you very much for the dedicated advice. Randy wrote: > That makes a great ...
9 years, 7 months ago (2011-05-10 07:41:53 UTC) #18
Paweł Hajdan Jr.
http://codereview.chromium.org/6905049/diff/10001/chrome/browser/download/download_item.h File chrome/browser/download/download_item.h (right): http://codereview.chromium.org/6905049/diff/10001/chrome/browser/download/download_item.h#newcode262 chrome/browser/download/download_item.h:262: bool is_path_exists() const { return is_path_exists_; } nit: is_path_exists ...
9 years, 7 months ago (2011-05-10 07:59:46 UTC) #19
haraken1
> http://codereview.chromium.org/6905049/diff/10001/chrome/browser/download/download_item.h > File chrome/browser/download/download_item.h (right): > > http://codereview.chromium.org/6905049/diff/10001/chrome/browser/download/download_item.h#newcode262 > chrome/browser/download/download_item.h:262: bool is_path_exists() const > ...
9 years, 7 months ago (2011-05-10 09:53:36 UTC) #20
Paweł Hajdan Jr.
> I wrote the setter just because currently all members in DownloadItem > class are ...
9 years, 7 months ago (2011-05-10 11:37:51 UTC) #21
Randy Smith (Not in Mondays)
This is definitely a step in the right direction; thank you. Some high level comments: ...
9 years, 7 months ago (2011-05-10 20:29:51 UTC) #22
haraken1
Dear Phajdan Thank you very much for your comments! >> Do you mean that we ...
9 years, 7 months ago (2011-05-12 04:07:03 UTC) #23
haraken1
I would really appreciate your dedicated review and clear explanation! > * The download shelf ...
9 years, 7 months ago (2011-05-12 04:07:14 UTC) #24
Randy Smith (Not in Mondays)
On 2011/05/12 04:07:03, haraken wrote: > (1) When the user reloads the chrome://downloads page, > ...
9 years, 7 months ago (2011-05-12 18:00:54 UTC) #25
Randy Smith (Not in Mondays)
On 2011/05/12 04:07:14, haraken wrote: > - When a user sees the race [1] unfortunately ...
9 years, 7 months ago (2011-05-12 18:04:44 UTC) #26
Randy Smith (Not in Mondays)
On 2011/05/12 04:07:14, haraken wrote: > > * The download shelf should also be updated ...
9 years, 7 months ago (2011-05-12 18:39:13 UTC) #27
Randy Smith (Not in Mondays)
Next round of comments; hopefully useful. Two notes: * I couldn't find any tests for ...
9 years, 7 months ago (2011-05-12 20:21:17 UTC) #28
Paweł Hajdan Jr.
+erg for GTK changes By the way, are you going to also update Windows/Mac UI ...
9 years, 7 months ago (2011-05-13 08:41:10 UTC) #29
Randy Smith (Not in Mondays)
On 2011/05/13 08:41:10, Paweł Hajdan Jr. wrote: > +erg for GTK changes erg: I'd recommend ...
9 years, 7 months ago (2011-05-13 13:33:38 UTC) #30
haraken1
Dear Pawel > By the way, are you going to also update Windows/Mac UI code? ...
9 years, 7 months ago (2011-05-13 14:05:50 UTC) #31
haraken1
Dear Randy >> - When a user sees the race [1] unfortunately and clicks the ...
9 years, 7 months ago (2011-05-13 14:05:52 UTC) #32
haraken1
http://codereview.chromium.org/6905049/diff/19001/chrome/browser/download/dow... File chrome/browser/download/download_item.h (right): http://codereview.chromium.org/6905049/diff/19001/chrome/browser/download/dow... chrome/browser/download/download_item.h:373: bool file_exists_; I also prefer |file_externally_removed_| in this case. ...
9 years, 7 months ago (2011-05-13 14:06:11 UTC) #33
haraken1
Sorry for the duplicate comments below (because of my operation mistake). http://codereview.chromium.org/6905049/diff/19001/chrome/browser/download/download_item.h File chrome/browser/download/download_item.h (right): ...
9 years, 7 months ago (2011-05-13 14:08:17 UTC) #34
Randy Smith (Not in Mondays)
On 2011/05/13 14:05:52, haraken wrote: > Dear Randy > > >> - When a user ...
9 years, 7 months ago (2011-05-13 20:08:40 UTC) #35
Randy Smith (Not in Mondays)
Next round. One high level comment: I had been imagining that the detection of the ...
9 years, 7 months ago (2011-05-13 20:45:32 UTC) #36
haraken1
> Nope, you're right; I read what you said and looked at the Views implementation, ...
9 years, 7 months ago (2011-05-16 11:42:27 UTC) #37
Randy Smith (Not in Mondays)
This is looking good; I think we're converging. Thanks for the hard work. With regard ...
9 years, 7 months ago (2011-05-16 20:57:12 UTC) #38
Paweł Hajdan Jr.
This is getting better, just a few comments. http://codereview.chromium.org/6905049/diff/28001/chrome/browser/download/download_item.cc File chrome/browser/download/download_item.cc (right): http://codereview.chromium.org/6905049/diff/28001/chrome/browser/download/download_item.cc#newcode263 chrome/browser/download/download_item.cc:263: download_manager_->CheckForFileRemoval(this); ...
9 years, 7 months ago (2011-05-17 20:03:39 UTC) #39
Randy Smith (Not in Mondays)
http://codereview.chromium.org/6905049/diff/28001/chrome/browser/download/download_item.cc File chrome/browser/download/download_item.cc (right): http://codereview.chromium.org/6905049/diff/28001/chrome/browser/download/download_item.cc#newcode263 chrome/browser/download/download_item.cc:263: download_manager_->CheckForFileRemoval(this); On 2011/05/17 20:03:39, Paweł Hajdan Jr. wrote: > ...
9 years, 7 months ago (2011-05-18 19:28:18 UTC) #40
Paweł Hajdan Jr.
http://codereview.chromium.org/6905049/diff/28001/chrome/browser/download/download_item.cc File chrome/browser/download/download_item.cc (right): http://codereview.chromium.org/6905049/diff/28001/chrome/browser/download/download_item.cc#newcode263 chrome/browser/download/download_item.cc:263: download_manager_->CheckForFileRemoval(this); On 2011/05/18 19:28:18, rdsmith wrote: > On 2011/05/17 ...
9 years, 7 months ago (2011-05-18 20:03:42 UTC) #41
Randy Smith (Not in Mondays)
http://codereview.chromium.org/6905049/diff/28001/chrome/browser/download/download_item.cc File chrome/browser/download/download_item.cc (right): http://codereview.chromium.org/6905049/diff/28001/chrome/browser/download/download_item.cc#newcode263 chrome/browser/download/download_item.cc:263: download_manager_->CheckForFileRemoval(this); On 2011/05/18 20:03:43, Paweł Hajdan Jr. wrote: > ...
9 years, 7 months ago (2011-05-18 20:13:13 UTC) #42
Paweł Hajdan Jr.
http://codereview.chromium.org/6905049/diff/28001/chrome/browser/download/download_item.cc File chrome/browser/download/download_item.cc (right): http://codereview.chromium.org/6905049/diff/28001/chrome/browser/download/download_item.cc#newcode263 chrome/browser/download/download_item.cc:263: download_manager_->CheckForFileRemoval(this); On 2011/05/18 20:13:13, rdsmith wrote: > Ah, thank ...
9 years, 7 months ago (2011-05-18 20:23:44 UTC) #43
haraken1
I am very sorry for this late reply... Finally, I confirmed that the download shelf ...
9 years, 6 months ago (2011-06-07 12:49:17 UTC) #44
haraken1
> Also, I thought that the name of DownloadItem::CanOpenDownload(), which judges whether we can > ...
9 years, 6 months ago (2011-06-07 12:53:58 UTC) #45
hendrickson_a
http://codereview.chromium.org/6905049/diff/38001/chrome/browser/download/download_manager_unittest.cc File chrome/browser/download/download_manager_unittest.cc (right): http://codereview.chromium.org/6905049/diff/38001/chrome/browser/download/download_manager_unittest.cc#newcode641 chrome/browser/download/download_manager_unittest.cc:641: DownloadCreateInfo* info(new DownloadCreateInfo); You need to get the latest ...
9 years, 6 months ago (2011-06-07 15:38:52 UTC) #46
Randy Smith (Not in Mondays)
Quick comment; will be coming back later to do a more thorough review. http://codereview.chromium.org/6905049/diff/38001/chrome/browser/resources/downloads.js File ...
9 years, 6 months ago (2011-06-07 18:51:09 UTC) #47
haraken1
http://codereview.chromium.org/6905049/diff/38001/chrome/browser/download/download_manager_unittest.cc File chrome/browser/download/download_manager_unittest.cc (right): http://codereview.chromium.org/6905049/diff/38001/chrome/browser/download/download_manager_unittest.cc#newcode641 chrome/browser/download/download_manager_unittest.cc:641: DownloadCreateInfo* info(new DownloadCreateInfo); On 2011/06/07 15:38:52, hendrickson_a wrote: > ...
9 years, 6 months ago (2011-06-08 05:11:49 UTC) #48
Paweł Hajdan Jr.
http://codereview.chromium.org/6905049/diff/44001/chrome/browser/download/download_item.cc File chrome/browser/download/download_item.cc (right): http://codereview.chromium.org/6905049/diff/44001/chrome/browser/download/download_item.cc#newcode240 chrome/browser/download/download_item.cc:240: return !Extension::IsExtension(state_info_.target_name); Shouldn't you check file_externally_removed_ here? http://codereview.chromium.org/6905049/diff/44001/chrome/browser/download/download_item.h File ...
9 years, 6 months ago (2011-06-08 09:58:40 UTC) #49
haraken1
http://codereview.chromium.org/6905049/diff/44001/chrome/browser/download/download_item.cc File chrome/browser/download/download_item.cc (right): http://codereview.chromium.org/6905049/diff/44001/chrome/browser/download/download_item.cc#newcode240 chrome/browser/download/download_item.cc:240: return !Extension::IsExtension(state_info_.target_name); I fixed it. (However, we may not ...
9 years, 6 months ago (2011-06-08 10:35:07 UTC) #50
Randy Smith (Not in Mondays)
erg, could you take a look at the GTK specific sections? thakis, dmazzoni, at the ...
9 years, 6 months ago (2011-06-08 22:07:54 UTC) #51
Elliot Glaysher
On 2011/06/08 22:07:54, rdsmith wrote: > erg, could you take a look at the GTK ...
9 years, 6 months ago (2011-06-08 22:13:18 UTC) #52
Nico
http://codereview.chromium.org/6905049/diff/49003/chrome/browser/ui/cocoa/download/download_item_cell.mm File chrome/browser/ui/cocoa/download/download_item_cell.mm (right): http://codereview.chromium.org/6905049/diff/49003/chrome/browser/ui/cocoa/download/download_item_cell.mm#newcode599 chrome/browser/ui/cocoa/download/download_item_cell.mm:599: [self animation:nil progressed:0.0]; Don't you want to animate this ...
9 years, 6 months ago (2011-06-08 22:18:33 UTC) #53
haraken1
http://codereview.chromium.org/6905049/diff/49003/chrome/browser/download/download_shelf_context_menu.cc File chrome/browser/download/download_shelf_context_menu.cc (right): http://codereview.chromium.org/6905049/diff/49003/chrome/browser/download/download_shelf_context_menu.cc#newcode44 chrome/browser/download/download_shelf_context_menu.cc:44: return download_item_->CanShowInFolder(); You are right. I fixed it. http://codereview.chromium.org/6905049/diff/49003/chrome/browser/resources/downloads.js ...
9 years, 6 months ago (2011-06-09 05:25:55 UTC) #54
haraken1
Would you please take a look at it? Cocoa change: thakis Views change: dmazzoni 2011年6月9日14:25 ...
9 years, 6 months ago (2011-06-13 14:05:41 UTC) #55
Paweł Hajdan Jr.
LGTM
9 years, 6 months ago (2011-06-13 14:34:08 UTC) #56
haraken1
Pawel: Thank you very much for the long discussion. If randy also says LGTM, I ...
9 years, 6 months ago (2011-06-13 16:27:48 UTC) #57
Randy Smith (Not in Mondays)
LGTM. Please don't commit without LGTMs from thakis and dmazzoni--I don't consider myself competent to ...
9 years, 6 months ago (2011-06-13 18:28:49 UTC) #58
Nico
LGTM
9 years, 6 months ago (2011-06-13 18:35:08 UTC) #59
haraken1
+pkasting I found dmazzoni is sabbatical. Pkasting: Would you please take a look at the ...
9 years, 6 months ago (2011-06-13 23:55:35 UTC) #60
Peter Kasting
views LGTM http://codereview.chromium.org/6905049/diff/51004/chrome/browser/ui/views/download/download_item_view.cc File chrome/browser/ui/views/download/download_item_view.cc (right): http://codereview.chromium.org/6905049/diff/51004/chrome/browser/ui/views/download/download_item_view.cc#newcode855 chrome/browser/ui/views/download/download_item_view.cc:855: (box_height_ - font_.GetHeight()) / 2 : kVerticalPadding); ...
9 years, 6 months ago (2011-06-14 18:26:06 UTC) #61
haraken1
I merged with the latest revision and re-confirmed that this patch works as expected on ...
9 years, 6 months ago (2011-06-15 00:59:29 UTC) #62
commit-bot: I haz the power
9 years, 6 months ago (2011-06-15 08:17:55 UTC) #63
Change committed as 89148

Powered by Google App Engine
This is Rietveld 408576698