Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/android/webapk/webapk_update_manager.h" | 5 #include "chrome/browser/android/webapk/webapk_update_manager.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.h> |
| 8 | 8 |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 | 44 |
| 45 // static JNI method. | 45 // static JNI method. |
| 46 static void UpdateAsync(JNIEnv* env, | 46 static void UpdateAsync(JNIEnv* env, |
| 47 const JavaParamRef<jclass>& clazz, | 47 const JavaParamRef<jclass>& clazz, |
| 48 const JavaParamRef<jstring>& java_start_url, | 48 const JavaParamRef<jstring>& java_start_url, |
| 49 const JavaParamRef<jstring>& java_scope, | 49 const JavaParamRef<jstring>& java_scope, |
| 50 const JavaParamRef<jstring>& java_name, | 50 const JavaParamRef<jstring>& java_name, |
| 51 const JavaParamRef<jstring>& java_short_name, | 51 const JavaParamRef<jstring>& java_short_name, |
| 52 const JavaParamRef<jstring>& java_icon_url, | 52 const JavaParamRef<jstring>& java_icon_url, |
| 53 const JavaParamRef<jobject>& java_icon_bitmap, | 53 const JavaParamRef<jobject>& java_icon_bitmap, |
| 54 jlong java_icon_murmur2_hash, | |
| 54 jint java_display_mode, | 55 jint java_display_mode, |
| 55 jint java_orientation, | 56 jint java_orientation, |
| 56 jlong java_theme_color, | 57 jlong java_theme_color, |
| 57 jlong java_background_color, | 58 jlong java_background_color, |
| 58 const JavaParamRef<jstring>& java_web_manifest_url, | 59 const JavaParamRef<jstring>& java_web_manifest_url, |
| 59 const JavaParamRef<jstring>& java_webapk_package, | 60 const JavaParamRef<jstring>& java_webapk_package, |
| 60 jint java_webapk_version) { | 61 jint java_webapk_version) { |
| 61 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 62 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 62 | 63 |
| 63 Profile* profile = ProfileManager::GetLastUsedProfile(); | 64 Profile* profile = ProfileManager::GetLastUsedProfile(); |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 86 SkBitmap icon_bitmap = gfx::CreateSkBitmapFromJavaBitmap(java_bitmap_lock); | 87 SkBitmap icon_bitmap = gfx::CreateSkBitmapFromJavaBitmap(java_bitmap_lock); |
| 87 icon_bitmap.setImmutable(); | 88 icon_bitmap.setImmutable(); |
| 88 | 89 |
| 89 std::string webapk_package; | 90 std::string webapk_package; |
| 90 ConvertJavaStringToUTF8(env, java_webapk_package, &webapk_package); | 91 ConvertJavaStringToUTF8(env, java_webapk_package, &webapk_package); |
| 91 | 92 |
| 92 WebApkInstaller* installer = new WebApkInstaller(info, icon_bitmap); | 93 WebApkInstaller* installer = new WebApkInstaller(info, icon_bitmap); |
| 93 installer->UpdateAsync( | 94 installer->UpdateAsync( |
| 94 profile, | 95 profile, |
| 95 base::Bind(&WebApkUpdateManager::OnBuiltWebApk, webapk_package), | 96 base::Bind(&WebApkUpdateManager::OnBuiltWebApk, webapk_package), |
| 97 std::to_string(java_icon_murmur2_hash), | |
|
pkotwicz
2016/08/19 23:38:17
I think that using base::Uint64ToString() is prefe
Xi Han
2016/08/26 17:54:08
I move the conversion to Java and pass a string di
| |
| 96 webapk_package, java_webapk_version); | 98 webapk_package, java_webapk_version); |
| 97 } | 99 } |
| OLD | NEW |