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

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

Issue 2199413003: Make WebAPK use "start URL longest path" as the scope if the scope is missing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into webapk_builder_impl2_scope Created 4 years, 4 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') | chrome/browser/android/webapk/webapk_installer.cc » ('j') | 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 9afc8153bd7de246235d75b5390318a9dccdd170..8d8066c310a37bb9e37964221bf3fe2f4cfe8027 100644
--- a/chrome/browser/android/shortcut_helper.cc
+++ b/chrome/browser/android/shortcut_helper.cc
@@ -283,6 +283,15 @@ bool ShortcutHelper::IsWebApkInstalled(const GURL& url) {
return Java_ShortcutHelper_isWebApkInstalled(env, java_url.obj());
}
+GURL ShortcutHelper::GetScopeFromURL(const GURL& url) {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ ScopedJavaLocalRef<jstring> java_url =
+ base::android::ConvertUTF8ToJavaString(env, url.spec());
+ ScopedJavaLocalRef<jstring> java_scope_url =
+ Java_ShortcutHelper_getScopeFromUrl(env, java_url.obj());
+ return GURL(base::android::ConvertJavaStringToUTF16(env, java_scope_url));
+}
+
// Callback used by Java when the shortcut has been created.
// |splash_image_callback| is a pointer to a base::Closure allocated in
// AddShortcutInBackgroundWithSkBitmap, so reinterpret_cast it back and run it.
« no previous file with comments | « chrome/browser/android/shortcut_helper.h ('k') | chrome/browser/android/webapk/webapk_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698