summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorbenjhayden@chromium.org <benjhayden@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-17 17:58:20 +0000
committerbenjhayden@chromium.org <benjhayden@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-17 17:58:20 +0000
commit77a7c431b7852e5ca16a729b1c2805347a1692eb (patch)
treeaa1701160d7a6d4b1c7b9d0ec2a6741cf533ab3e /chrome/common
parent07af85b6b3d6331635ef0436f4d8117f2ac188b9 (diff)
downloadchromium_src-77a7c431b7852e5ca16a729b1c2805347a1692eb.zip
chromium_src-77a7c431b7852e5ca16a729b1c2805347a1692eb.tar.gz
chromium_src-77a7c431b7852e5ca16a729b1c2805347a1692eb.tar.bz2
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
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/extensions/api/downloads.idl6
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/common/extensions/api/downloads.idl b/chrome/common/extensions/api/downloads.idl
index 4b8f5b0..38a85bd 100644
--- a/chrome/common/extensions/api/downloads.idl
+++ b/chrome/common/extensions/api/downloads.idl
@@ -380,8 +380,10 @@ namespace downloads {
};
[inline_doc] dictionary GetFileIconOptions {
- // The size of the icon. The returned icon will be square with dimensions
- // size * size pixels. The default size for the icon is 32x32 pixels.
+ // The size of the returned icon. The icon will be square with dimensions
+ // size * size pixels. The default and largest size for the icon is 32x32
+ // pixels. The only supported sizes are 16 and 32. It is an error to specify
+ // any other size.
[legalValues=(16,32)] long? size;
};