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

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

Issue 2363183002: Skip installation process if WebAPK is already installed. (Closed)
Patch Set: Created 4 years, 3 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/browser/android/shortcut_helper.cc
diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc
index e1e00710a58ed2af243150e80c1d0daaf29cb09e..e5c087287bc505fc2071687ff8033745eb4f4ad4 100644
--- a/chrome/browser/android/shortcut_helper.cc
+++ b/chrome/browser/android/shortcut_helper.cc
@@ -244,6 +244,22 @@ SkBitmap ShortcutHelper::FinalizeLauncherIconInBackground(
}
// static
+std::string ShortcutHelper::QueryWebApkPackage(const GURL& url) {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ ScopedJavaLocalRef<jstring> java_url =
+ base::android::ConvertUTF8ToJavaString(env, url.spec());
+ ScopedJavaLocalRef<jstring> java_webapk_package_name =
+ Java_ShortcutHelper_queryWebApkPackage(env, java_url);
+
+ std::string webapk_package_name = "";
+ if (java_webapk_package_name.obj()) {
+ webapk_package_name = base::android::ConvertJavaStringToUTF8(
+ env, java_webapk_package_name);
+ }
+ return webapk_package_name;
+}
+
+// static
bool ShortcutHelper::IsWebApkInstalled(const GURL& url) {
JNIEnv* env = base::android::AttachCurrentThread();
ScopedJavaLocalRef<jstring> java_url =

Powered by Google App Engine
This is Rietveld 408576698