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

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

Issue 2714633003: Adds more metadata to the about:webapks page (Closed)
Patch Set: Adds more metadata to the about:webapks page 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
Index: chrome/browser/android/shortcut_helper.cc
diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc
index 8b1b30b760834ccb7b96e583234ded1d2251f4ef..be9293f77735e3f43c311e14455918a28f04e18f 100644
--- a/chrome/browser/android/shortcut_helper.cc
+++ b/chrome/browser/android/shortcut_helper.cc
@@ -331,11 +331,22 @@ void OnWebappDataStored(JNIEnv* env,
void OnWebApksRetrieved(JNIEnv* env,
const JavaParamRef<jclass>& clazz,
const jlong jcallback_pointer,
+ const JavaParamRef<jobjectArray>& jnames,
const JavaParamRef<jobjectArray>& jshort_names,
const JavaParamRef<jobjectArray>& jpackage_names,
const JavaParamRef<jintArray>& jshell_apk_versions,
- const JavaParamRef<jintArray>& jversion_codes) {
+ const JavaParamRef<jintArray>& jversion_codes,
+ const JavaParamRef<jobjectArray>& juris,
+ const JavaParamRef<jobjectArray>& jscopes,
+ const JavaParamRef<jobjectArray>& jmanifest_urls,
+ const JavaParamRef<jobjectArray>& jmanifest_start_urls,
+ const JavaParamRef<jintArray>& jdisplay_modes,
+ const JavaParamRef<jintArray>& jorientations,
+ const JavaParamRef<jlongArray>& jtheme_colors,
+ const JavaParamRef<jlongArray>& jbackground_colors) {
DCHECK(jcallback_pointer);
+ std::vector<std::string> names;
+ base::android::AppendJavaStringArrayToStringVector(env, jnames, &names);
std::vector<std::string> short_names;
base::android::AppendJavaStringArrayToStringVector(env, jshort_names,
&short_names);
@@ -347,17 +358,51 @@ void OnWebApksRetrieved(JNIEnv* env,
&shell_apk_versions);
std::vector<int> version_codes;
base::android::JavaIntArrayToIntVector(env, jversion_codes, &version_codes);
-
+ std::vector<std::string> uris;
+ base::android::AppendJavaStringArrayToStringVector(env, juris, &uris);
+ std::vector<std::string> scopes;
+ base::android::AppendJavaStringArrayToStringVector(env, jscopes, &scopes);
+ std::vector<std::string> manifest_urls;
+ base::android::AppendJavaStringArrayToStringVector(env, jmanifest_urls,
+ &manifest_urls);
+ std::vector<std::string> manifest_start_urls;
+ base::android::AppendJavaStringArrayToStringVector(env, jmanifest_start_urls,
+ &manifest_start_urls);
+ std::vector<int> display_modes;
+ base::android::JavaIntArrayToIntVector(env, jdisplay_modes, &display_modes);
+ std::vector<int> orientations;
+ base::android::JavaIntArrayToIntVector(env, jorientations, &orientations);
+ std::vector<int64_t> theme_colors;
+ base::android::JavaLongArrayToInt64Vector(env, jtheme_colors, &theme_colors);
+ std::vector<int64_t> background_colors;
+ base::android::JavaLongArrayToInt64Vector(env, jbackground_colors,
+ &background_colors);
+
+ DCHECK(short_names.size() == names.size());
DCHECK(short_names.size() == package_names.size());
DCHECK(short_names.size() == shell_apk_versions.size());
DCHECK(short_names.size() == version_codes.size());
+ DCHECK(short_names.size() == uris.size());
+ DCHECK(short_names.size() == scopes.size());
+ DCHECK(short_names.size() == manifest_urls.size());
+ DCHECK(short_names.size() == manifest_start_urls.size());
+ DCHECK(short_names.size() == display_modes.size());
+ DCHECK(short_names.size() == orientations.size());
+ DCHECK(short_names.size() == theme_colors.size());
+ DCHECK(short_names.size() == background_colors.size());
std::vector<WebApkInfo> webapk_list;
webapk_list.reserve(short_names.size());
for (size_t i = 0; i < short_names.size(); ++i) {
- webapk_list.push_back(WebApkInfo(std::move(short_names[i]),
- std::move(package_names[i]),
- shell_apk_versions[i], version_codes[i]));
+ webapk_list.push_back(WebApkInfo(
+ std::move(names[i]), std::move(short_names[i]),
+ std::move(package_names[i]), shell_apk_versions[i], version_codes[i],
+ std::move(uris[i]), std::move(scopes[i]), std::move(manifest_urls[i]),
+ std::move(manifest_start_urls[i]),
+ static_cast<blink::WebDisplayMode>(std::move(display_modes[i])),
pkotwicz 2017/02/27 20:50:59 The blink::WebDisplayMode does not need to be move
gonzalon 2017/02/27 21:33:17 Done.
+ static_cast<blink::WebScreenOrientationLockType>(
+ std::move(orientations[i])),
pkotwicz 2017/02/27 20:50:59 The blink::WebScreenOrientationLockType does not n
gonzalon 2017/02/27 21:33:17 Done.
+ std::move(theme_colors[i]), std::move(background_colors[i])));
pkotwicz 2017/02/27 20:50:58 The colors don't need to be moved. The colors are
gonzalon 2017/02/27 21:33:17 Done.
}
ShortcutHelper::WebApkInfoCallback* webapk_list_callback =

Powered by Google App Engine
This is Rietveld 408576698