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

Issue 137043005: Fix chrome.downloads.getFileIcon for hi-dpi and clarify docs. (Closed)

Created:
6 years, 11 months ago by benjhayden
Modified:
6 years, 11 months ago
CC:
chromium-reviews, benjhayden+dwatch_chromium.org, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, flackr
Visibility:
Public.

Description

Fix chrome.downloads.getFileIcon for hi-dpi and clarify docs. BUG=334358 TEST: On a Pixel, install a downloads extension such as this. https://chrome.google.com/webstore/detail/download-manager-button/jglgknilkoejnnjngnmoobbhdckpdmem Either right-click on the browser action button and Inspect Popup, or open the background page console. If there are no downloads, download a file so that there's a file icon to inspect. One easy way to download a file is to open this data url and click the link: data:text/html,<a href="data:application/octet-stream," download=test-137043005.txt>download an empty file Copy this javascript into the Developer Tools console: chrome.downloads.search({limit:1}, function(items) {matchMedia('screen and (-webkit-min-device-pixel-ratio: 1.5)').addListener(function() {chrome.downloads.getFileIcon(items[0].id, function(icon) {console.log('dpr', devicePixelRatio, icon);});});}); This javascript finds a DownloadItem and listens for the devicePixelRatio to change, then fetches the file icon for the new devicePixelRatio. Type Ctrl+Shift+- and Ctrl+Shift+= to decrease and increase the screen resolution until the console logs at least one line that begins with 'dpr 1' and another line that begins with 'dpr 2'. You might need to increase and/or decrease the resolution several times. The rest of the 'dpr 1' line should be different from the rest of the 'dpr 2' line. If the rest of those lines are the same, then this fix is broken. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=245550

Patch Set 1 #

Patch Set 2 : fix hi-dpi #

Total comments: 4

Patch Set 3 : . #

Patch Set 4 : sync #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -13 lines) Patch
M chrome/browser/download/download_file_icon_extractor.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api.cc View 1 2 5 chunks +19 lines, -11 lines 0 comments Download
M chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/downloads.idl View 1 2 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
benjhayden
Asanka, can you review my use of gfx::Image/SkBitmap or point me to somebody else? Kalman: ...
6 years, 11 months ago (2014-01-14 19:09:41 UTC) #1
not at google - send to devlin
lgtm for downloads.idl https://codereview.chromium.org/137043005/diff/20001/chrome/common/extensions/api/downloads.idl File chrome/common/extensions/api/downloads.idl (right): https://codereview.chromium.org/137043005/diff/20001/chrome/common/extensions/api/downloads.idl#newcode384 chrome/common/extensions/api/downloads.idl:384: // pixels. Valid values are 16 ...
6 years, 11 months ago (2014-01-14 19:16:23 UTC) #2
asanka
The change makes sense, but someone more familiar with high dpi issues should review. +oshima: ...
6 years, 11 months ago (2014-01-14 19:20:24 UTC) #3
benjhayden
On 2014/01/14 19:20:24, asanka wrote: > The change makes sense, but someone more familiar with ...
6 years, 11 months ago (2014-01-14 19:36:02 UTC) #4
oshima
On 2014/01/14 19:20:24, asanka wrote: > The change makes sense, but someone more familiar with ...
6 years, 11 months ago (2014-01-14 19:44:46 UTC) #5
benjhayden
On 2014/01/14 19:44:46, oshima wrote: > On 2014/01/14 19:20:24, asanka wrote: > > The change ...
6 years, 11 months ago (2014-01-14 21:25:32 UTC) #6
oshima
On 2014/01/14 21:25:32, benjhayden_chromium wrote: > On 2014/01/14 19:44:46, oshima wrote: > > On 2014/01/14 ...
6 years, 11 months ago (2014-01-14 21:39:47 UTC) #7
benjhayden
On 2014/01/14 21:39:47, oshima wrote: > On 2014/01/14 21:25:32, benjhayden_chromium wrote: > > On 2014/01/14 ...
6 years, 11 months ago (2014-01-14 22:02:23 UTC) #8
oshima
On 2014/01/14 22:02:23, benjhayden_chromium wrote: > On 2014/01/14 21:39:47, oshima wrote: > > On 2014/01/14 ...
6 years, 11 months ago (2014-01-14 22:15:52 UTC) #9
benjhayden
On 2014/01/14 22:15:52, oshima wrote: > On 2014/01/14 22:02:23, benjhayden_chromium wrote: > > On 2014/01/14 ...
6 years, 11 months ago (2014-01-14 22:44:26 UTC) #10
oshima
On 2014/01/14 22:44:26, benjhayden_chromium wrote: > On 2014/01/14 22:15:52, oshima wrote: > > On 2014/01/14 ...
6 years, 11 months ago (2014-01-14 22:50:19 UTC) #11
benjhayden
On 2014/01/14 22:50:19, oshima wrote: > On 2014/01/14 22:44:26, benjhayden_chromium wrote: > > On 2014/01/14 ...
6 years, 11 months ago (2014-01-14 22:58:11 UTC) #12
oshima
I see, thank you for testing. + +pkotwicz@ who worked on it before.
6 years, 11 months ago (2014-01-14 23:34:58 UTC) #13
pkotwicz
LGTM. Can you please add some manual testing steps to the CL description or the ...
6 years, 11 months ago (2014-01-15 02:33:36 UTC) #14
benjhayden
https://codereview.chromium.org/137043005/diff/20001/chrome/browser/extensions/api/downloads/downloads_api.cc File chrome/browser/extensions/api/downloads/downloads_api.cc (right): https://codereview.chromium.org/137043005/diff/20001/chrome/browser/extensions/api/downloads/downloads_api.cc#newcode328 chrome/browser/extensions/api/downloads/downloads_api.cc:328: base::Bind(&DownloadFileIconExtractorImpl::OnIconLoadComplete, On 2014/01/15 02:33:37, pkotwicz wrote: > Would it ...
6 years, 11 months ago (2014-01-15 23:58:19 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benjhayden@chromium.org/137043005/310001
6 years, 11 months ago (2014-01-16 17:40:11 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benjhayden@chromium.org/137043005/310001
6 years, 11 months ago (2014-01-17 16:31:41 UTC) #17
commit-bot: I haz the power
6 years, 11 months ago (2014-01-17 17:58:24 UTC) #18
Message was sent while issue was closed.
Change committed as 245550

Powered by Google App Engine
This is Rietveld 408576698