OLD | NEW |
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 Loading... |
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 |
OLD | NEW |