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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Create a copy of the callback here and send the pointer to Java, which | 90 // Create a copy of the callback here and send the pointer to Java, which |
91 // will send it back once the asynchronous shortcut creation process | 91 // will send it back once the asynchronous shortcut creation process |
92 // finishes. | 92 // finishes. |
93 callback_pointer = | 93 callback_pointer = |
94 reinterpret_cast<uintptr_t>(new base::Closure(splash_image_callback)); | 94 reinterpret_cast<uintptr_t>(new base::Closure(splash_image_callback)); |
95 } | 95 } |
96 | 96 |
97 Java_ShortcutHelper_addShortcut( | 97 Java_ShortcutHelper_addShortcut( |
98 env, | 98 env, |
99 java_webapp_id.obj(), | 99 java_webapp_id.obj(), |
| 100 static_cast<int>(info.type), |
100 java_url.obj(), | 101 java_url.obj(), |
101 java_user_title.obj(), | 102 java_user_title.obj(), |
102 java_name.obj(), | 103 java_name.obj(), |
103 java_short_name.obj(), | 104 java_short_name.obj(), |
104 java_bitmap.obj(), | 105 java_bitmap.obj(), |
105 info.display, | 106 info.display, |
106 info.orientation, | 107 info.orientation, |
107 info.source, | 108 info.source, |
108 info.theme_color, | 109 info.theme_color, |
109 info.background_color, | 110 info.background_color, |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 DCHECK(jsplash_image_callback); | 221 DCHECK(jsplash_image_callback); |
221 base::Closure* splash_image_callback = | 222 base::Closure* splash_image_callback = |
222 reinterpret_cast<base::Closure*>(jsplash_image_callback); | 223 reinterpret_cast<base::Closure*>(jsplash_image_callback); |
223 splash_image_callback->Run(); | 224 splash_image_callback->Run(); |
224 delete splash_image_callback; | 225 delete splash_image_callback; |
225 } | 226 } |
226 | 227 |
227 bool ShortcutHelper::RegisterShortcutHelper(JNIEnv* env) { | 228 bool ShortcutHelper::RegisterShortcutHelper(JNIEnv* env) { |
228 return RegisterNativesImpl(env); | 229 return RegisterNativesImpl(env); |
229 } | 230 } |
OLD | NEW |