| Index: chrome/browser/android/shortcut_helper.cc
|
| diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc
|
| index 4c7a38362706a7fd0fec07b057b764b8327d084a..80cd8f60f154409c1b9f6b0b4bc770460516d052 100644
|
| --- a/chrome/browser/android/shortcut_helper.cc
|
| +++ b/chrome/browser/android/shortcut_helper.cc
|
| @@ -26,11 +26,14 @@ using content::Manifest;
|
| // static
|
| void ShortcutHelper::AddShortcutInBackgroundWithSkBitmap(
|
| const ShortcutInfo& info,
|
| + const std::string& id,
|
| const SkBitmap& icon_bitmap) {
|
| DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
|
|
|
| // Send the data to the Java side to create the shortcut.
|
| JNIEnv* env = base::android::AttachCurrentThread();
|
| + ScopedJavaLocalRef<jstring> java_id =
|
| + base::android::ConvertUTF8ToJavaString(env, id);
|
| ScopedJavaLocalRef<jstring> java_url =
|
| base::android::ConvertUTF8ToJavaString(env, info.url.spec());
|
| ScopedJavaLocalRef<jstring> java_user_title =
|
| @@ -46,6 +49,7 @@ void ShortcutHelper::AddShortcutInBackgroundWithSkBitmap(
|
| Java_ShortcutHelper_addShortcut(
|
| env,
|
| base::android::GetApplicationContext(),
|
| + java_id.obj(),
|
| java_url.obj(),
|
| java_user_title.obj(),
|
| java_name.obj(),
|
| @@ -58,6 +62,24 @@ void ShortcutHelper::AddShortcutInBackgroundWithSkBitmap(
|
| info.background_color);
|
| }
|
|
|
| +void ShortcutHelper::AddSplashscreenIconToWebappData(
|
| + const std::string& id,
|
| + const SkBitmap& splash_icon) {
|
| + // Send the data to the Java side to create the shortcut.
|
| + JNIEnv* env = base::android::AttachCurrentThread();
|
| + ScopedJavaLocalRef<jstring> java_id =
|
| + base::android::ConvertUTF8ToJavaString(env, id);
|
| + ScopedJavaLocalRef<jobject> java_splash_icon;
|
| + if (!splash_icon.drawsNothing())
|
| + java_splash_icon = gfx::ConvertToJavaBitmap(&splash_icon);
|
| +
|
| + Java_ShortcutHelper_addSplashscreenIconToWebappData(
|
| + env,
|
| + base::android::GetApplicationContext(),
|
| + java_id.obj(),
|
| + java_splash_icon.obj());
|
| +}
|
| +
|
| bool ShortcutHelper::RegisterShortcutHelper(JNIEnv* env) {
|
| return RegisterNativesImpl(env);
|
| }
|
|
|