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

Side by Side Diff: chrome/browser/android/shortcut_helper.cc

Issue 2050933002: Upstream: Add additional checks before creating a WebAPK after clicking "Add to Homescreen" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698