Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java

Issue 38523002: Using largest favicon for shortcut when possible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pass in launcher_large_icon_size Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
index 4a617233c96d5af336083cc9673ecdd94edd9389..329a67e3da6f299dfb486082fc594b8bf30f735e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
@@ -4,6 +4,7 @@
package org.chromium.chrome.browser;
+import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
@@ -41,12 +42,14 @@ public class ShortcutHelper {
* @param tab Tab to create a shortcut for.
Yaron 2013/10/25 18:50:17 Nit: update
michaelbai 2013/10/25 19:01:00 Done.
* @param userRequestedTitle Updated title for the shortcut.
*/
- public static void addShortcut(TabBase tab, String userRequestedTitle) {
+ public static void addShortcut(Context appContext, TabBase tab, String userRequestedTitle) {
if (TextUtils.isEmpty(sFullScreenAction)) {
Log.e("ShortcutHelper", "ShortcutHelper is uninitialized. Aborting.");
return;
}
- nativeAddShortcut(tab.getNativePtr(), userRequestedTitle);
+ ActivityManager am = (ActivityManager) appContext.getSystemService(
+ Context.ACTIVITY_SERVICE);
+ nativeAddShortcut(tab.getNativePtr(), userRequestedTitle, am.getLauncherLargeIconSize());
}
/**
@@ -91,5 +94,6 @@ public class ShortcutHelper {
context.startActivity(homeIntent);
}
- private static native void nativeAddShortcut(int tabAndroidPtr, String userRequestedTitle);
+ private static native void nativeAddShortcut(int tabAndroidPtr, String userRequestedTitle,
+ int launcherLargeIconSize);
}

Powered by Google App Engine
This is Rietveld 408576698