| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shortcut_helper.h" | 5 #include "chrome/browser/android/shortcut_helper.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.h> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_array.h" | 10 #include "base/android/jni_array.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 ScopedJavaLocalRef<jstring> java_user_title = | 158 ScopedJavaLocalRef<jstring> java_user_title = |
| 159 base::android::ConvertUTF16ToJavaString(env, info.user_title); | 159 base::android::ConvertUTF16ToJavaString(env, info.user_title); |
| 160 ScopedJavaLocalRef<jobject> java_bitmap; | 160 ScopedJavaLocalRef<jobject> java_bitmap; |
| 161 if (icon_bitmap.getSize()) | 161 if (icon_bitmap.getSize()) |
| 162 java_bitmap = gfx::ConvertToJavaBitmap(&icon_bitmap); | 162 java_bitmap = gfx::ConvertToJavaBitmap(&icon_bitmap); |
| 163 | 163 |
| 164 Java_ShortcutHelper_addShortcut(env, java_url.obj(), java_user_title.obj(), | 164 Java_ShortcutHelper_addShortcut(env, java_url.obj(), java_user_title.obj(), |
| 165 java_bitmap.obj(), info.source); | 165 java_bitmap.obj(), info.source); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void ShortcutHelper::OnBuiltWebApk(bool success) { | 168 void ShortcutHelper::OnBuiltWebApk(bool success, |
| 169 const std::string& webapk_package) { |
| 169 if (success) { | 170 if (success) { |
| 170 LOG(ERROR) << "Sent request to install WebAPK. Seems to have worked."; | 171 LOG(ERROR) << "Sent request to install WebAPK. Seems to have worked."; |
| 171 } else { | 172 } else { |
| 172 LOG(ERROR) << "WebAPK install failed."; | 173 LOG(ERROR) << "WebAPK install failed."; |
| 173 } | 174 } |
| 174 // TODO(pkotwicz): Figure out what to do when installing WebAPK fails. | 175 // TODO(pkotwicz): Figure out what to do when installing WebAPK fails. |
| 175 // (crbug.com/626950) | 176 // (crbug.com/626950) |
| 176 } | 177 } |
| 177 | 178 |
| 178 int ShortcutHelper::GetIdealHomescreenIconSizeInDp() { | 179 int ShortcutHelper::GetIdealHomescreenIconSizeInDp() { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 DCHECK(jsplash_image_callback); | 293 DCHECK(jsplash_image_callback); |
| 293 base::Closure* splash_image_callback = | 294 base::Closure* splash_image_callback = |
| 294 reinterpret_cast<base::Closure*>(jsplash_image_callback); | 295 reinterpret_cast<base::Closure*>(jsplash_image_callback); |
| 295 splash_image_callback->Run(); | 296 splash_image_callback->Run(); |
| 296 delete splash_image_callback; | 297 delete splash_image_callback; |
| 297 } | 298 } |
| 298 | 299 |
| 299 bool ShortcutHelper::RegisterShortcutHelper(JNIEnv* env) { | 300 bool ShortcutHelper::RegisterShortcutHelper(JNIEnv* env) { |
| 300 return RegisterNativesImpl(env); | 301 return RegisterNativesImpl(env); |
| 301 } | 302 } |
| OLD | NEW |