| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 JNIEnv* env = base::android::AttachCurrentThread(); | 42 JNIEnv* env = base::android::AttachCurrentThread(); |
| 43 jobject j_shell_manager = g_global_state.Get().j_shell_manager.obj(); | 43 jobject j_shell_manager = g_global_state.Get().j_shell_manager.obj(); |
| 44 Java_ShellManager_removeShell(env, j_shell_manager, shell_view); | 44 Java_ShellManager_removeShell(env, j_shell_manager, shell_view); |
| 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, jclass clazz, jobject obj) { | 52 static void Init(JNIEnv* env, |
| 53 const JavaParamRef<jclass>& clazz, |
| 54 const JavaParamRef<jobject>& obj) { |
| 53 g_global_state.Get().j_shell_manager.Reset( | 55 g_global_state.Get().j_shell_manager.Reset( |
| 54 base::android::ScopedJavaLocalRef<jobject>(env, obj)); | 56 base::android::ScopedJavaLocalRef<jobject>(env, obj)); |
| 55 } | 57 } |
| 56 | 58 |
| 57 void LaunchShell(JNIEnv* env, jclass clazz, jstring jurl) { | 59 void LaunchShell(JNIEnv* env, |
| 60 const JavaParamRef<jclass>& clazz, |
| 61 const JavaParamRef<jstring>& jurl) { |
| 58 ShellBrowserContext* browserContext = | 62 ShellBrowserContext* browserContext = |
| 59 ShellContentBrowserClient::Get()->browser_context(); | 63 ShellContentBrowserClient::Get()->browser_context(); |
| 60 GURL url(base::android::ConvertJavaStringToUTF8(env, jurl)); | 64 GURL url(base::android::ConvertJavaStringToUTF8(env, jurl)); |
| 61 Shell::CreateNewWindow(browserContext, | 65 Shell::CreateNewWindow(browserContext, |
| 62 url, | 66 url, |
| 63 NULL, | 67 NULL, |
| 64 gfx::Size()); | 68 gfx::Size()); |
| 65 } | 69 } |
| 66 | 70 |
| 67 } // namespace content | 71 } // namespace content |
| OLD | NEW |