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

Unified Diff: chrome/browser/android/shortcut_helper.cc

Issue 2689993002: Refactor the INSTALL_SHORTCUT broadcast code into ChromeShortcutManager (Closed)
Patch Set: Change according to review comments. Created 3 years, 10 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 | « chrome/browser/android/shortcut_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/shortcut_helper.cc
diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc
index aa309f6060dc9ecac2cfd5e1ca1f71a8dc6112d3..e72c483fb30b1c6f8a8e07007bb3b81754eb8844 100644
--- a/chrome/browser/android/shortcut_helper.cc
+++ b/chrome/browser/android/shortcut_helper.cc
@@ -79,7 +79,7 @@ void ShortcutHelper::AddToLauncherWithSkBitmap(
AddWebappWithSkBitmap(info, webapp_id, icon_bitmap, splash_image_callback);
return;
}
- AddShortcutWithSkBitmap(info, icon_bitmap);
+ AddShortcutWithSkBitmap(info, webapp_id, icon_bitmap);
}
// static
@@ -134,8 +134,11 @@ void ShortcutHelper::AddWebappWithSkBitmap(
}
void ShortcutHelper::AddShortcutWithSkBitmap(const ShortcutInfo& info,
+ const std::string& id,
const SkBitmap& icon_bitmap) {
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 =
@@ -144,8 +147,8 @@ void ShortcutHelper::AddShortcutWithSkBitmap(const ShortcutInfo& info,
if (icon_bitmap.getSize())
java_bitmap = gfx::ConvertToJavaBitmap(&icon_bitmap);
- Java_ShortcutHelper_addShortcut(env, java_url, java_user_title, java_bitmap,
- info.source);
+ Java_ShortcutHelper_addShortcut(env, java_id, java_url, java_user_title,
+ java_bitmap, info.source);
}
void ShortcutHelper::ShowWebApkInstallInProgressToast() {
« no previous file with comments | « chrome/browser/android/shortcut_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698