| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "sky/shell/java_service_provider.h" | 5 #include "sky/shell/java_service_provider.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" |
| 7 #include "jni/JavaServiceProvider_jni.h" | 8 #include "jni/JavaServiceProvider_jni.h" |
| 8 | 9 |
| 9 namespace sky { | 10 namespace sky { |
| 10 namespace shell { | 11 namespace shell { |
| 11 | 12 |
| 12 bool RegisterJavaServiceProvider(JNIEnv* env) { | 13 bool RegisterJavaServiceProvider(JNIEnv* env) { |
| 13 return RegisterNativesImpl(env); | 14 return RegisterNativesImpl(env); |
| 14 } | 15 } |
| 15 | 16 |
| 16 mojo::ScopedMessagePipeHandle CreateJavaServiceProvider() { | 17 mojo::ScopedMessagePipeHandle CreateJavaServiceProvider() { |
| 17 JNIEnv* env = base::android::AttachCurrentThread(); | 18 JNIEnv* env = base::android::AttachCurrentThread(); |
| 18 return mojo::ScopedMessagePipeHandle( | 19 return mojo::ScopedMessagePipeHandle( |
| 19 mojo::MessagePipeHandle(Java_JavaServiceProvider_create(env))); | 20 mojo::MessagePipeHandle(Java_JavaServiceProvider_create( |
| 21 env, base::android::GetApplicationContext()))); |
| 20 } | 22 } |
| 21 | 23 |
| 22 } // namespace shell | 24 } // namespace shell |
| 23 } // namespace sky | 25 } // namespace sky |
| OLD | NEW |