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

Side by Side Diff: content/shell/android/shell_manager.cc

Issue 1326763009: jni: Forbid inappropriate JNI parameter conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GN-only mojo, and chromecast Created 5 years, 3 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/shell/android/shell_manager.h" 5 #include "content/shell/android/shell_manager.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 46
47 // Register native methods 47 // Register native methods
48 bool RegisterShellManager(JNIEnv* env) { 48 bool RegisterShellManager(JNIEnv* env) {
49 return RegisterNativesImpl(env); 49 return RegisterNativesImpl(env);
50 } 50 }
51 51
52 static void Init(JNIEnv* env, 52 static void Init(JNIEnv* env,
53 const JavaParamRef<jclass>& clazz, 53 const JavaParamRef<jclass>& clazz,
54 const JavaParamRef<jobject>& obj) { 54 const JavaParamRef<jobject>& obj) {
55 g_global_state.Get().j_shell_manager.Reset( 55 g_global_state.Get().j_shell_manager.Reset(obj);
56 base::android::ScopedJavaLocalRef<jobject>(env, obj));
57 } 56 }
58 57
59 void LaunchShell(JNIEnv* env, 58 void LaunchShell(JNIEnv* env,
60 const JavaParamRef<jclass>& clazz, 59 const JavaParamRef<jclass>& clazz,
61 const JavaParamRef<jstring>& jurl) { 60 const JavaParamRef<jstring>& jurl) {
62 ShellBrowserContext* browserContext = 61 ShellBrowserContext* browserContext =
63 ShellContentBrowserClient::Get()->browser_context(); 62 ShellContentBrowserClient::Get()->browser_context();
64 GURL url(base::android::ConvertJavaStringToUTF8(env, jurl)); 63 GURL url(base::android::ConvertJavaStringToUTF8(env, jurl));
65 Shell::CreateNewWindow(browserContext, 64 Shell::CreateNewWindow(browserContext,
66 url, 65 url,
67 NULL, 66 NULL,
68 gfx::Size()); 67 gfx::Size());
69 } 68 }
70 69
71 } // namespace content 70 } // namespace content
OLDNEW
« no previous file with comments | « components/cronet/android/cronet_library_loader.cc ('k') | mojo/android/javatests/mojo_test_case.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698