зеркало из https://github.com/mozilla/gecko-dev.git
Bug 749618 - Use a default icon for webapps without one. r=mfinkle
This commit is contained in:
Родитель
e4ad9c5094
Коммит
ccb6ecd388
|
@ -44,7 +44,7 @@ function onLoad(aEvent) {
|
|||
AppsUI.shortcut = contextmenus.add(gStrings.GetStringFromName("appsContext.shortcut"), contextmenus.SelectorContext("div[mozApp]"),
|
||||
function(aTarget) {
|
||||
let manifest = aTarget.manifest;
|
||||
gChromeWin.WebappsUI.createShortcut(manifest.name, manifest.fullLaunchPath(), manifest.iconURLForSize("64"), "webapp");
|
||||
gChromeWin.WebappsUI.createShortcut(manifest.name, manifest.fullLaunchPath(), gChromeWin.WebappsUI.getBiggestIcon(manifest.icons), "webapp");
|
||||
});
|
||||
AppsUI.uninstall = contextmenus.add(gStrings.GetStringFromName("appsContext.uninstall"), contextmenus.SelectorContext("div[mozApp]"),
|
||||
function(aTarget) {
|
||||
|
@ -97,7 +97,7 @@ function addApplication(aApp) {
|
|||
container.setAttribute("title", manifest.name);
|
||||
|
||||
let img = document.createElement("img");
|
||||
img.src = manifest.iconURLForSize("64");
|
||||
img.src = gChromeWin.WebappsUI.getBiggestIcon(manifest.icons);
|
||||
img.setAttribute("title", manifest.name);
|
||||
|
||||
let title = document.createElement("div");
|
||||
|
|
|
@ -5704,7 +5704,7 @@ var WebappsUI = {
|
|||
|
||||
// Add a homescreen shortcut -- we can't use createShortcut, since we need to pass
|
||||
// a unique ID for Android webapp allocation
|
||||
this.makeBase64Icon(manifest.iconURLForSize("64"),
|
||||
this.makeBase64Icon(this.getBiggestIcon(manifest.icons),
|
||||
function(icon) {
|
||||
sendMessageToJava({
|
||||
gecko: {
|
||||
|
@ -5741,6 +5741,17 @@ var WebappsUI = {
|
|||
}
|
||||
},
|
||||
|
||||
getBiggestIcon: function getBiggestIcon(aIcons) {
|
||||
if (!aIcons)
|
||||
return "chrome://browser/skin/images/default-app-icon.png";
|
||||
|
||||
let iconSizes = Object.keys(aIcons);
|
||||
if (iconSizes.length == 0)
|
||||
return "chrome://browser/skin/images/default-app-icon.png";
|
||||
iconSizes.sort(function(a, b) a - b);
|
||||
return aIcons[iconSizes.pop()];
|
||||
}
|
||||
|
||||
doInstall: function doInstall(aData) {
|
||||
let manifest = new DOMApplicationManifest(aData.app.manifest, aData.app.origin);
|
||||
let name = manifest.name ? manifest.name : manifest.fullLaunchPath();
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 2.9 KiB |
|
@ -32,6 +32,7 @@ chrome.jar:
|
|||
skin/images/checkbox_unchecked.png (images/checkbox_unchecked.png)
|
||||
skin/images/checkbox_unchecked_disabled.png (images/checkbox_unchecked_disabled.png)
|
||||
skin/images/checkbox_unchecked_pressed.png (images/checkbox_unchecked_pressed.png)
|
||||
skin/images/default-app-icon.png (images/default-app-icon.png)
|
||||
skin/images/dropmarker.svg (images/dropmarker.svg)
|
||||
skin/images/errorpage-warning.png (images/errorpage-warning.png)
|
||||
skin/images/errorpage-warning.png (images/errorpage-warning.png)
|
||||
|
|
Загрузка…
Ссылка в новой задаче