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.
Review URL: https://codereview.chromium.org/
137043005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245550 0039d316-1c4b-4281-b951-d872f2087c98