| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "blimp/client/core/contents/android/blimp_contents_factory.h" | 5 #include "blimp/client/core/contents/android/blimp_contents_factory.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "blimp/client/core/contents/android/blimp_contents_impl_android.h" | 9 #include "blimp/client/core/contents/android/blimp_contents_impl_android.h" |
| 10 #include "blimp/client/core/contents/blimp_contents_impl.h" | 10 #include "blimp/client/core/contents/blimp_contents_impl.h" |
| 11 #include "jni/BlimpContentsFactory_jni.h" | 11 #include "jni/BlimpContentsFactory_jni.h" |
| 12 | 12 |
| 13 using base::android::JavaParamRef; | 13 using base::android::JavaParamRef; |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 const int kDummyTabId = 0; | 16 const int kDummyTabId = 0; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace blimp { | 19 namespace blimp { |
| 20 namespace client { | 20 namespace client { |
| 21 | 21 |
| 22 static base::android::ScopedJavaLocalRef<jobject> CreateBlimpContents( | 22 static base::android::ScopedJavaLocalRef<jobject> CreateBlimpContents( |
| 23 JNIEnv* env, | 23 JNIEnv* env, |
| 24 const JavaParamRef<jclass>& clazz) { | 24 const JavaParamRef<jclass>& clazz) { |
| 25 // To delete |blimp_contents_impl|, the Java caller must call the | 25 // To delete |blimp_contents_impl|, the Java caller must call the |
| 26 // destroy() method on BlimpContents. | 26 // destroy() method on BlimpContents. |
| 27 BlimpContentsImpl* blimp_contents_impl = new BlimpContentsImpl(kDummyTabId); | 27 BlimpContentsImpl* blimp_contents_impl = new BlimpContentsImpl(kDummyTabId); |
| 28 return blimp_contents_impl->GetJavaBlimpContentsImpl(); | 28 return blimp_contents_impl->GetJavaObject(); |
| 29 } | 29 } |
| 30 | 30 |
| 31 bool RegisterBlimpContentsFactoryJni(JNIEnv* env) { | 31 bool RegisterBlimpContentsFactoryJni(JNIEnv* env) { |
| 32 return RegisterNativesImpl(env); | 32 return RegisterNativesImpl(env); |
| 33 } | 33 } |
| 34 | 34 |
| 35 } // namespace client | 35 } // namespace client |
| 36 } // namespace blimp | 36 } // namespace blimp |
| OLD | NEW |