-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decrease download shelf height and show origin url on hover #9521
Conversation
ad26fce
to
69cb2c6
Compare
69cb2c6
to
a5b0b17
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These updates look great! 😄 I tested a few scenarios (downloading a file quick, large file, resize, etc). The chevron area shows the filename when moused over which is perfect (since person would usually use that for open in folder). Rest of shelf item shows the origin in a very readable way
The patches LGTM! Would be great to get review from @brave/patch-reviewers in case I missed something
@nullhook can you take a look at brave/brave-browser#5533? I would think this is fixed; but curious if you're able to repro before your change |
chromium_src/chrome/browser/ui/views/download/download_item_view.cc
Outdated
Show resolved
Hide resolved
3041756
to
556fa40
Compare
chromium_src/chrome/browser/ui/views/download/download_item_view.cc
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include
need to be fixed.
52e6505
to
6dfd540
Compare
6dfd540
to
16ad921
Compare
When downloading a large file the DownloadItemView is supposed to show certain information about the item being downloaded, such as the name and the current status. Additionally, it's also meant to show the URL but, due to changes done recently in PR 9521 [1] (see issue in [2]), Brave contains changes to only show the URL when hovering over the download item view, to save space. Turns out that these changes were causing a crash after a the change below landed upstream and the reason seems to be that our chromium_src override was wrongly redefining the Button symbol way beyond the scope of download_item_view.cc, causing the crash. This change includes the necessary headers from download_item_view.cc to avoid this Button redefinition from propagating any further, and also makes the most of the effort to fix some small things in the override file, such as calling the parent methods of the overriden methods from the Button class, or adding some extra documentation. Last, this change also fixes 2 crashing browser tests: * BraveCheckClientDownloadRequestBaseBrowserTest.FilterRequest * SavePackageFinishedObserverBrowserTest.Success [1] #9521 [2] brave/brave-browser#1638 Chromium change: https://source.chromium.org/chromium/chromium/src/+/03f006384e02fb387c177af07a3df9792e364e18 commit 03f006384e02fb387c177af07a3df9792e364e18 Author: Peter Kasting <[email protected]> Date: Thu Jul 22 00:45:59 2021 +0000 Clicking the download item context button should close any open menu. This is what other buttons in Chrome do: repeatedly clicking the button toggles it between open and closed, instead of flickering it closed and instantly reopening (the current behavior). Bug: 1031682
When downloading a large file the DownloadItemView is supposed to show certain information about the item being downloaded, such as the name and the current status. Additionally, it's also meant to show the URL but, due to changes done recently in PR 9521 [1] (see issue in [2]), Brave contains changes to only show the URL when hovering over the download item view, to save space. Turns out that these changes were causing a crash after a the change below landed upstream and the reason seems to be that our chromium_src override was wrongly redefining the Button symbol way beyond the scope of download_item_view.cc, causing the crash. This change includes the necessary headers from download_item_view.cc to avoid this Button redefinition from propagating any further, and also makes the most of the effort to fix some small things in the override file, such as calling the parent methods of the overriden methods from the Button class, or adding some extra documentation. Last, this change also fixes 2 crashing browser tests: * BraveCheckClientDownloadRequestBaseBrowserTest.FilterRequest * SavePackageFinishedObserverBrowserTest.Success [1] #9521 [2] brave/brave-browser#1638 Chromium change: https://source.chromium.org/chromium/chromium/src/+/03f006384e02fb387c177af07a3df9792e364e18 commit 03f006384e02fb387c177af07a3df9792e364e18 Author: Peter Kasting <[email protected]> Date: Thu Jul 22 00:45:59 2021 +0000 Clicking the download item context button should close any open menu. This is what other buttons in Chrome do: repeatedly clicking the button toggles it between open and closed, instead of flickering it closed and instantly reopening (the current behavior). Bug: 1031682
When downloading a large file the DownloadItemView is supposed to show certain information about the item being downloaded, such as the name and the current status. Additionally, it's also meant to show the URL but, due to changes done recently in PR 9521 [1] (see issue in [2]), Brave contains changes to only show the URL when hovering over the download item view, to save space. Turns out that these changes were causing a crash after a the change below landed upstream and the reason seems to be that our chromium_src override was wrongly redefining the Button symbol way beyond the scope of download_item_view.cc, causing the crash. This change includes the necessary headers from download_item_view.cc to avoid this Button redefinition from propagating any further, and also makes the most of the effort to fix some small things in the override file, such as calling the parent methods of the overriden methods from the Button class, or adding some extra documentation. Last, this change also fixes 2 crashing browser tests: * BraveCheckClientDownloadRequestBaseBrowserTest.FilterRequest * SavePackageFinishedObserverBrowserTest.Success [1] #9521 [2] brave/brave-browser#1638 Chromium change: https://source.chromium.org/chromium/chromium/src/+/03f006384e02fb387c177af07a3df9792e364e18 commit 03f006384e02fb387c177af07a3df9792e364e18 Author: Peter Kasting <[email protected]> Date: Thu Jul 22 00:45:59 2021 +0000 Clicking the download item context button should close any open menu. This is what other buttons in Chrome do: repeatedly clicking the button toggles it between open and closed, instead of flickering it closed and instantly reopening (the current behavior). Bug: 1031682
This decreases the whole download shelf height and hides the origin url by default. The origin url is only visible on hover and on tab focus.
TransparentButton
is overlaid on top of DownloadItemView and the static cast is needed to access specific events such as:OnViewFocused
andOnViewBlurred
which isn't part ofparent()
View itself. It's part of ViewObserver class.Here is the definition of TransparentButton: https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ui/views/download/download_item_view.cc;l=146
Resolves brave/brave-browser#1638
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: