mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Sriram Ramasubramanian <sriram@mozilla.com>
This commit is contained in:
parent
6e669b10cf
commit
f9e19fc2e5
@ -129,8 +129,11 @@ public class LauncherShortcuts extends ListActivity {
|
||||
size = 72;
|
||||
}
|
||||
|
||||
Bitmap bitmap = Bitmap.createScaledBitmap(BitmapFactory.decodeFile(favicon), size, size, true);
|
||||
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, bitmap);
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(favicon);
|
||||
if (bitmap != null) {
|
||||
Bitmap scaledBitmap = Bitmap.createScaledBitmap(bitmap, size, size, true);
|
||||
intent.putExtra(Intent.EXTRA_SHORTCUT_ICON, scaledBitmap);
|
||||
}
|
||||
|
||||
// Now, return the result to the launcher
|
||||
setResult(RESULT_OK, intent);
|
||||
|
@ -141,9 +141,10 @@ let OpenWebapps = {
|
||||
this._writeFile(this.appsFile, JSON.stringify(this.webapps));
|
||||
|
||||
// now save the icon as icon.png in the app directory
|
||||
let iconURI = aApplication.iconURI ? aApplication.iconURI : "chrome://browser/skin/images/homescreen-default-hdpi.png";
|
||||
let iconFile = dir.clone();
|
||||
iconFile.append("icon.png");
|
||||
let uri = Services.io.newURI(aApplication.iconURI, null, null);
|
||||
let uri = Services.io.newURI(iconURI, null, null);
|
||||
let persist = Cc["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"].createInstance(Ci.nsIWebBrowserPersist);
|
||||
persist.persistFlags = persist.PERSIST_FLAGS_REPLACE_EXISTING_FILES | persist.PERSIST_FLAGS_BYPASS_CACHE;
|
||||
persist.saveURI(uri, null, null, null, "", iconFile);
|
||||
|
Loading…
Reference in New Issue
Block a user