| 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_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 NOTREACHED(); | 198 NOTREACHED(); |
| 199 } | 199 } |
| 200 } | 200 } |
| 201 | 201 |
| 202 // Adds a shortcut to the current URL to the Android home screen, firing | 202 // Adds a shortcut to the current URL to the Android home screen, firing |
| 203 // background tasks to pull all the data required. | 203 // background tasks to pull all the data required. |
| 204 // Note that we don't actually care about the tab here -- we just want | 204 // Note that we don't actually care about the tab here -- we just want |
| 205 // its otherwise inaccessible WebContents. | 205 // its otherwise inaccessible WebContents. |
| 206 static void AddShortcut(JNIEnv* env, | 206 static void AddShortcut(JNIEnv* env, |
| 207 jclass clazz, | 207 jclass clazz, |
| 208 jint tab_android_ptr, | 208 jlong tab_android_ptr, |
| 209 jstring title, | 209 jstring title, |
| 210 jint launcher_large_icon_size) { | 210 jint launcher_large_icon_size) { |
| 211 TabAndroid* tab = reinterpret_cast<TabAndroid*>(tab_android_ptr); | 211 TabAndroid* tab = reinterpret_cast<TabAndroid*>(tab_android_ptr); |
| 212 ShortcutHelper::AddShortcut( | 212 ShortcutHelper::AddShortcut( |
| 213 tab->web_contents(), | 213 tab->web_contents(), |
| 214 base::android::ConvertJavaStringToUTF16(env, title), | 214 base::android::ConvertJavaStringToUTF16(env, title), |
| 215 launcher_large_icon_size); | 215 launcher_large_icon_size); |
| 216 } | 216 } |
| OLD | NEW |