mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 17:59:34 +00:00
Bug 1054712 - Remove duplicate logic from tabbrowser and search bar by using the getImageURLForResolution helper function in PlacesUtils. r=MattN
This commit is contained in:
parent
e5c228e808
commit
29a48d1281
@ -85,6 +85,9 @@
|
||||
Components.classes["@mozilla.org/autocomplete/search;1?name=unifiedcomplete"]
|
||||
.getService(Components.interfaces.mozIPlacesAutoComplete);
|
||||
</field>
|
||||
<field name="PlacesUtils" readonly="true">
|
||||
(Components.utils.import("resource://gre/modules/PlacesUtils.jsm", {})).PlacesUtils;
|
||||
</field>
|
||||
<field name="mTabBox" readonly="true">
|
||||
document.getAnonymousElementByAttribute(this, "anonid", "tabbox");
|
||||
</field>
|
||||
@ -840,9 +843,7 @@
|
||||
|
||||
let sizedIconUrl = browser.mIconURL || "";
|
||||
if (sizedIconUrl) {
|
||||
let size = Math.round(16 * window.devicePixelRatio);
|
||||
sizedIconUrl += (sizedIconUrl.contains("#") ? "&" : "#") +
|
||||
"-moz-resolution=" + size + "," + size;
|
||||
sizedIconUrl = this.PlacesUtils.getImageURLForResolution(window, sizedIconUrl);
|
||||
}
|
||||
if (sizedIconUrl != aTab.getAttribute("image")) {
|
||||
if (sizedIconUrl)
|
||||
|
@ -125,6 +125,9 @@
|
||||
<field name="FormHistory" readonly="true">
|
||||
(Components.utils.import("resource://gre/modules/FormHistory.jsm", {})).FormHistory;
|
||||
</field>
|
||||
<field name="PlacesUtils" readonly="true">
|
||||
(Components.utils.import("resource://gre/modules/PlacesUtils.jsm", {})).PlacesUtils;
|
||||
</field>
|
||||
|
||||
<property name="engines" readonly="true">
|
||||
<getter><![CDATA[
|
||||
@ -292,9 +295,7 @@
|
||||
<parameter name="uri"/>
|
||||
<body><![CDATA[
|
||||
if (uri) {
|
||||
let size = Math.round(16 * window.devicePixelRatio);
|
||||
if (!uri.contains("#"))
|
||||
uri += "#-moz-resolution=" + size + "," + size;
|
||||
uri = this.PlacesUtils.getImageURLForResolution(window, uri);
|
||||
}
|
||||
element.setAttribute("src", uri);
|
||||
]]></body>
|
||||
|
Loading…
x
Reference in New Issue
Block a user