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

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: Sync 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
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/ShortcutHelperTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e1f56db71e56b44334541861dc185ecf834b281c 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;
@@ -38,15 +39,18 @@ public class ShortcutHelper {
/**
* Adds a shortcut for the current Tab.
+ * @param appContext The application context.
* @param tab Tab to create a shortcut for.
* @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 +95,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);
}
« no previous file with comments | « no previous file | chrome/android/javatests/src/org/chromium/chrome/browser/ShortcutHelperTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698