| Index: chrome/browser/resources/md_history/app.crisper.js
|
| diff --git a/chrome/browser/resources/md_history/app.crisper.js b/chrome/browser/resources/md_history/app.crisper.js
|
| index 91fc353a883ddcf1fbfa32dd667add7cebf88cc9..114855e9baa677e0fd47435805aaccf7f43e5a7e 100644
|
| --- a/chrome/browser/resources/md_history/app.crisper.js
|
| +++ b/chrome/browser/resources/md_history/app.crisper.js
|
| @@ -6685,20 +6685,17 @@ Polymer({
|
| cr.define('cr.icon', function() {
|
| function getSupportedScaleFactors() {
|
| var supportedScaleFactors = [];
|
| - if (cr.isMac || cr.isChromeOS || cr.isWindows || cr.isLinux) {
|
| + if (!cr.isIOS) {
|
| supportedScaleFactors.push(1);
|
| + }
|
| + if (cr.isMac || cr.isChromeOS || cr.isWindows || cr.isLinux) {
|
| supportedScaleFactors.push(2);
|
| } else {
|
| supportedScaleFactors.push(window.devicePixelRatio);
|
| }
|
| return supportedScaleFactors;
|
| }
|
| - function getProfileAvatarIcon(path) {
|
| - var chromeThemePath = 'chrome://theme';
|
| - var isDefaultAvatar = path.slice(0, chromeThemePath.length) == chromeThemePath;
|
| - return isDefaultAvatar ? imageset(path + '@scalefactorx') : url(path);
|
| - }
|
| - function imageset(path) {
|
| + function getImageSet(path) {
|
| var supportedScaleFactors = getSupportedScaleFactors();
|
| var replaceStartIndex = path.indexOf('scalefactor');
|
| if (replaceStartIndex < 0) return url(path);
|
| @@ -6711,16 +6708,20 @@ cr.define('cr.icon', function() {
|
| }
|
| return '-webkit-image-set(' + s + ')';
|
| }
|
| + function getImage(path) {
|
| + var chromeThemePath = 'chrome://theme';
|
| + var isChromeThemeUrl = path.slice(0, chromeThemePath.length) == chromeThemePath;
|
| + return isChromeThemeUrl ? getImageSet(path + '@scalefactorx') : url(path);
|
| + }
|
| var FAVICON_URL_REGEX = /\.ico$/i;
|
| - function getFaviconImageSet(url, opt_size, opt_type) {
|
| + function getFavicon(url, opt_size, opt_type) {
|
| var size = opt_size || 16;
|
| var type = opt_type || 'favicon';
|
| - return imageset('chrome://' + type + '/size/' + size + '@scalefactorx/' + (FAVICON_URL_REGEX.test(url) ? 'iconurl/' : '') + url);
|
| + return getImageSet('chrome://' + type + '/size/' + size + '@scalefactorx/' + (FAVICON_URL_REGEX.test(url) ? 'iconurl/' : '') + url);
|
| }
|
| return {
|
| - getSupportedScaleFactors: getSupportedScaleFactors,
|
| - getProfileAvatarIcon: getProfileAvatarIcon,
|
| - getFaviconImageSet: getFaviconImageSet
|
| + getImage: getImage,
|
| + getFavicon: getFavicon
|
| };
|
| });
|
|
|
| @@ -6844,7 +6845,7 @@ cr.define('md_history', function() {
|
| md_history.BrowserService.getInstance().recordAction('EntryLinkRightClick');
|
| },
|
| showIcon_: function() {
|
| - this.$.icon.style.backgroundImage = cr.icon.getFaviconImageSet(this.item.url);
|
| + this.$.icon.style.backgroundImage = cr.icon.getFavicon(this.item.url);
|
| },
|
| selectionNotAllowed_: function() {
|
| return !loadTimeData.getBoolean('allowDeletingHistory');
|
| @@ -7093,7 +7094,7 @@ Polymer({
|
| return [ 'groupedHistoryData_', groupIndex, 'domains', domainIndex, 'visits', itemIndex ].join('.');
|
| },
|
| getWebsiteIconStyle_: function(domain) {
|
| - return 'background-image: ' + cr.icon.getFaviconImageSet(domain.visits[0].url);
|
| + return 'background-image: ' + cr.icon.getFavicon(domain.visits[0].url);
|
| },
|
| getDropdownIcon_: function(expanded) {
|
| return expanded ? 'cr:expand-less' : 'cr:expand-more';
|
| @@ -8347,7 +8348,7 @@ Polymer({
|
| this.async(function() {
|
| var icons = Polymer.dom(this.root).querySelectorAll('.website-icon');
|
| for (var i = 0; i < this.tabs.length; i++) {
|
| - icons[i].style.backgroundImage = cr.icon.getFaviconImageSet(this.tabs[i].url);
|
| + icons[i].style.backgroundImage = cr.icon.getFavicon(this.tabs[i].url);
|
| }
|
| });
|
| },
|
|
|