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

Issue 209613002: Download shelf autohides on showing in shell, just same as regular open

Created:
6 years, 9 months ago by DukeXar
Modified:
4 years ago
CC:
benjhayden+dwatch_chromium.org, chromium-reviews, darin-cc_chromium.org, jam, joi+watch-content_chromium.org, Randy Smith (Not in Mondays)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Download shelf autohides on showing in shell, just same as regular open Autohide is activated only if user has 'shown' the download item in shell after download has been completed. BUG=89924 R=benjhayden@chromium.org

Patch Set 1 : Implement a separate callbacks flow for 'shown in shell' event to not mix with 'opened' #

Total comments: 8

Patch Set 2 : Move the 'user acted' flag into DownloadItemModelData and get rid of SetOpened/SetShown in Download… #

Total comments: 3

Patch Set 3 : Using ChromeDownloadManagerDelegate to carry 'acted' state forward. #

Patch Set 4 : Added browser and unit tests. Renamed 'UserActed' to 'OpenedOrShown'. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+261 lines, -51 lines) Patch
M AUTHORS View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/download/all_download_item_notifier.h View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/download/all_download_item_notifier.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/download/all_download_item_notifier_unittest.cc View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/download/chrome_download_manager_delegate.cc View 1 2 3 3 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/download/download_browsertest.cc View 1 2 3 4 chunks +88 lines, -1 line 0 comments Download
M chrome/browser/download/download_item_model.h View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/download/download_item_model.cc View 1 2 3 3 chunks +15 lines, -1 line 0 comments Download
M chrome/browser/download/download_item_model_unittest.cc View 1 2 3 1 chunk +32 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/ntp_snippets/fake_download_item.h View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ntp_snippets/fake_download_item.cc View 1 2 3 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/platform_util.cc View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/platform_util_internal.h View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/platform_util_linux.cc View 1 2 3 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/platform_util_mac.mm View 1 2 3 2 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/platform_util_win.cc View 1 2 3 1 chunk +6 lines, -5 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_controller.h View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_controller.mm View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_controller_unittest.mm View 1 2 3 1 chunk +7 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_mac.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_mac.mm View 1 2 3 1 chunk +6 lines, -1 line 0 comments Download
M chrome/browser/ui/cocoa/download/download_shelf_controller.h View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_shelf_controller.mm View 1 2 3 4 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/cocoa/download/download_shelf_controller_unittest.mm View 1 2 3 5 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/download/download_item_view.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/download/download_item_view.cc View 1 2 3 1 chunk +6 lines, -1 line 0 comments Download
M chrome/browser/ui/views/download/download_shelf_view.h View 1 2 3 2 chunks +7 lines, -1 line 0 comments Download
M chrome/browser/ui/views/download/download_shelf_view.cc View 1 2 3 3 chunks +14 lines, -6 lines 0 comments Download
M content/browser/download/download_item_impl.h View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/download/download_item_impl.cc View 1 2 3 2 chunks +4 lines, -6 lines 0 comments Download
M content/browser/download/download_manager_impl_unittest.cc View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M content/public/browser/download_item.h View 1 2 3 2 chunks +1 line, -3 lines 0 comments Download
M content/public/test/mock_download_item.h View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M content/public/test/mock_download_item.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (1 generated)
DukeXar
6 years, 9 months ago (2014-03-24 00:20:52 UTC) #1
DukeXar
Could you please review this patch.
6 years, 9 months ago (2014-03-24 00:25:13 UTC) #2
benjhayden
+felt, asanka, rdsmith: Can one of you help us figure out what the shelf should ...
6 years, 9 months ago (2014-03-24 18:07:45 UTC) #3
Randy Smith (Not in Mondays)
I think Asanka's the right person to review this patch; I'll stay out of it ...
6 years, 9 months ago (2014-03-24 18:12:20 UTC) #4
DukeXar
On 2014/03/24 18:07:45, benjhayden_chromium wrote: > +felt, asanka, rdsmith: Can one of you help us ...
6 years, 9 months ago (2014-03-24 18:31:23 UTC) #5
asanka
All comments are welcome! I'm in favor of this behavior change. But there are a ...
6 years, 9 months ago (2014-03-25 19:54:33 UTC) #6
DukeXar
On 2014/03/25 19:54:33, asanka wrote: > All comments are welcome! > > I'm in favor ...
6 years, 8 months ago (2014-03-31 10:51:22 UTC) #7
asanka
On 2014/03/31 10:51:22, DukeXar wrote: > On 2014/03/25 19:54:33, asanka wrote: > > All comments ...
6 years, 8 months ago (2014-03-31 20:40:18 UTC) #8
DukeXar
There will be two separate flags in download item: 'opened' and 'shown'. The observer will ...
6 years, 7 months ago (2014-05-01 18:40:04 UTC) #9
benjhayden
On 2014/05/01 18:40:04, DukeXar wrote: > There will be two separate flags in download item: ...
6 years, 7 months ago (2014-05-01 18:55:08 UTC) #10
DukeXar
On 2014/05/01 18:55:08, benjhayden_chromium wrote: > On 2014/05/01 18:40:04, DukeXar wrote: > > There will ...
6 years, 7 months ago (2014-05-01 23:02:33 UTC) #11
DukeXar
On 2014/05/01 23:02:33, DukeXar wrote: > On 2014/05/01 18:55:08, benjhayden_chromium wrote: > > On 2014/05/01 ...
6 years, 7 months ago (2014-05-13 23:36:36 UTC) #12
asanka
https://codereview.chromium.org/209613002/diff/20001/chrome/browser/ui/views/download/download_shelf_view.cc File chrome/browser/ui/views/download/download_shelf_view.cc (right): https://codereview.chromium.org/209613002/diff/20001/chrome/browser/ui/views/download/download_shelf_view.cc#newcode164 chrome/browser/ui/views/download/download_shelf_view.cc:164: void DownloadShelfView::ShownDownload(DownloadItemView* view) { Shall we rename this DownloadShown ...
6 years, 7 months ago (2014-05-14 18:40:59 UTC) #13
DukeXar
On 2014/05/14 18:40:59, asanka wrote: > https://codereview.chromium.org/209613002/diff/20001/chrome/browser/ui/views/download/download_shelf_view.cc > File chrome/browser/ui/views/download/download_shelf_view.cc (right): > > https://codereview.chromium.org/209613002/diff/20001/chrome/browser/ui/views/download/download_shelf_view.cc#newcode164 > ...
6 years, 6 months ago (2014-06-03 15:27:52 UTC) #14
asanka
On 2014/06/03 15:27:52, DukeXar wrote: > On 2014/05/14 18:40:59, asanka wrote: > > > https://codereview.chromium.org/209613002/diff/20001/chrome/browser/ui/views/download/download_shelf_view.cc ...
6 years, 6 months ago (2014-06-05 19:26:18 UTC) #15
asanka
https://codereview.chromium.org/209613002/diff/20001/content/browser/download/download_item_impl.h File content/browser/download/download_item_impl.h (right): https://codereview.chromium.org/209613002/diff/20001/content/browser/download/download_item_impl.h#newcode549 content/browser/download/download_item_impl.h:549: bool shownWhenComplete_; Nit: unix_hacker_style_
6 years, 6 months ago (2014-06-05 19:26:28 UTC) #16
DukeXar
https://codereview.chromium.org/209613002/diff/20001/chrome/browser/ui/views/download/download_shelf_view.cc File chrome/browser/ui/views/download/download_shelf_view.cc (right): https://codereview.chromium.org/209613002/diff/20001/chrome/browser/ui/views/download/download_shelf_view.cc#newcode164 chrome/browser/ui/views/download/download_shelf_view.cc:164: void DownloadShelfView::ShownDownload(DownloadItemView* view) { On 2014/05/14 18:40:59, asanka wrote: ...
6 years, 6 months ago (2014-06-06 15:07:14 UTC) #17
DukeXar
Could you please look at recent patch, please. I have built and tested this on ...
6 years, 6 months ago (2014-06-06 15:11:30 UTC) #18
asanka
https://codereview.chromium.org/209613002/diff/60001/chrome/browser/download/download_item_model.cc File chrome/browser/download/download_item_model.cc (right): https://codereview.chromium.org/209613002/diff/60001/chrome/browser/download/download_item_model.cc#newcode42 chrome/browser/download/download_item_model.cc:42: public DownloadItem::Observer { Let's try to avoid having the ...
6 years, 6 months ago (2014-06-12 21:08:48 UTC) #19
DukeXar
Hello, I have updated this quite old code review. I think I have now implemented ...
5 years ago (2015-11-29 22:46:51 UTC) #20
asanka
On 2015/11/29 at 22:46:51, DukeXar wrote: > Hello, I have updated this quite old code ...
5 years ago (2015-12-01 15:55:54 UTC) #21
asanka
On 2015/12/01 at 15:55:54, asanka wrote: > On 2015/11/29 at 22:46:51, DukeXar wrote: > > ...
5 years ago (2015-12-02 15:59:38 UTC) #22
asanka
On 2015/12/02 at 15:59:38, asanka wrote: > On 2015/12/01 at 15:55:54, asanka wrote: > > ...
4 years, 1 month ago (2016-11-01 17:41:05 UTC) #24
DukeXar
On 2016/11/01 17:41:05, asanka wrote: > On 2015/12/02 at 15:59:38, asanka wrote: > > On ...
4 years, 1 month ago (2016-11-02 00:15:38 UTC) #25
DukeXar
On 2016/11/02 00:15:38, DukeXar wrote: > On 2016/11/01 17:41:05, asanka wrote: > > On 2015/12/02 ...
4 years, 1 month ago (2016-11-14 02:44:44 UTC) #26
DukeXar
4 years ago (2016-11-23 17:26:47 UTC) #27
On 2016/11/14 02:44:44, DukeXar wrote:
> On 2016/11/02 00:15:38, DukeXar wrote:
> > On 2016/11/01 17:41:05, asanka wrote:
> > > On 2015/12/02 at 15:59:38, asanka wrote:
> > > > On 2015/12/01 at 15:55:54, asanka wrote:
> > > > > On 2015/11/29 at 22:46:51, DukeXar wrote:
> > > > > > Hello, I have updated this quite old code review.
> > > > > 
> > > > > Code LG so far.
> > > > > 
> > > > > > I think I have now implemented it in a way that was suggested by
> > @asanka.
> > > Can you please take a look?
> > > > > > 
> > > > > > I am not sure how tests for this could be implemented for this -
> please
> > > advise.
> > > > > 
> > > > > See //chrome/browser/download/download_browsertest.cc for some
examples.
> > > Specifically the DownloadTestWithShelf.AutoOpen test at
> > >
> >
>
https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/dow...
> > > . You could do something similar where you manually trigger a download to
be
> > > shown in the folder and then see if the download shelf is still open.
> > > > > 
> > > > > The tricky bit is to mock out the actual shell invocation so that the
> > > browser test doesn't interact with the actual desktop. We don't want
> > > browser_tests to interact with the desktop or open random application
> windows.
> > > So you'd need to break up the Open/ShowInFolder logic in
> > > ChromeDownloadManagerDelegate does everything except actually invoke the
> > > platform when showing a download in the shell during the browser_test.
> > > > > 
> > > > > > The changes have not touched download history, download API and
stats,
> > so
> > > I have questions about that:
> > > > > > 1. Should it record any stats event for 'show' as it does in
> RecordOpen?
> > > > 
> > > > Nope. We recorded stats for Open because we want the data to guide how
we
> > > design the download open behavior. "Show in folder" doesn't have any plans
> of
> > > factoring into this decision.
> > > > 
> > > > > > 2. Should it be exposed in API (is there any need for that at all,
as
> it
> > > seems that having just 'opened' is probably fine).
> > > > 
> > > > Hmm. On the fence on this one. I'm reluctant to change the meaning of
> > 'opened'
> > > to mean 'acted upon' mostly because the assumptions extension writers have
> > made
> > > based on that flag are unknowable at this point. But I see your points
that
> > > wiring it through 'opened' is probably fine.
> > > > 
> > > > If I had to decide, I'd probably leave it alone.
> > > > 
> > > > > > 3. Should it be recorded in history?
> > > > 
> > > > No, for the same reason as 1 above. Recording 'open' was a means of
> getting
> > at
> > > the 'time to first open' statistic.
> > > > 
> > > > > > 
> > > > > > Thank you.
> > > 
> > > Ping?
> > 
> > Oh, I am sorry - I have completely lost track of this. Let me take a look at
> the
> > tests again.
> 
> Uploaded a new changeset.
> 
> 1. Rebased on master.
> 2. Changed order of when OnDownloadOpened and OnDownloadShown are called - now
> action is taken first, then notification is called, otherwise it is impossible
> to track any state.
> 3. Modified platform_util::ShowItemInFolder to allow disabling shell
operations
> using existing flag, and enabled it in browser tests.
> 4. Updated browser tests and unit tests.
> 
> What you think?

PTAL when you have time.

Powered by Google App Engine
This is Rietveld 408576698