| 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_impl_android.h" | 5 #include "blimp/client/core/contents/android/blimp_contents_impl_android.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_navigation_controller_impl_an
droid.h" | 9 #include "blimp/client/core/contents/android/blimp_navigation_controller_impl_an
droid.h" |
| 10 #include "jni/BlimpContentsImpl_jni.h" | 10 #include "jni/BlimpContentsImpl_jni.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 } | 31 } |
| 32 | 32 |
| 33 BlimpContentsImplAndroid::BlimpContentsImplAndroid( | 33 BlimpContentsImplAndroid::BlimpContentsImplAndroid( |
| 34 BlimpContentsImpl* blimp_contents_impl) | 34 BlimpContentsImpl* blimp_contents_impl) |
| 35 : blimp_contents_impl_(blimp_contents_impl), | 35 : blimp_contents_impl_(blimp_contents_impl), |
| 36 blimp_navigation_controller_impl_android_( | 36 blimp_navigation_controller_impl_android_( |
| 37 static_cast<BlimpNavigationControllerImpl*>( | 37 static_cast<BlimpNavigationControllerImpl*>( |
| 38 &(blimp_contents_impl->GetNavigationController()))) { | 38 &(blimp_contents_impl->GetNavigationController()))) { |
| 39 JNIEnv* env = base::android::AttachCurrentThread(); | 39 JNIEnv* env = base::android::AttachCurrentThread(); |
| 40 | 40 |
| 41 java_obj_.Reset( | 41 java_obj_.Reset(env, |
| 42 env, Java_BlimpContentsImpl_create( | 42 Java_BlimpContentsImpl_create( |
| 43 env, reinterpret_cast<intptr_t>(this), | 43 env, reinterpret_cast<intptr_t>(this), |
| 44 blimp_navigation_controller_impl_android_.GetJavaObject().obj()) | 44 blimp_navigation_controller_impl_android_.GetJavaObject()) |
| 45 .obj()); | 45 .obj()); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void BlimpContentsImplAndroid::Destroy(JNIEnv* env, jobject jobj) { | 48 void BlimpContentsImplAndroid::Destroy(JNIEnv* env, jobject jobj) { |
| 49 delete blimp_contents_impl_; | 49 delete blimp_contents_impl_; |
| 50 } | 50 } |
| 51 | 51 |
| 52 BlimpContentsImplAndroid::~BlimpContentsImplAndroid() { | 52 BlimpContentsImplAndroid::~BlimpContentsImplAndroid() { |
| 53 Java_BlimpContentsImpl_clearNativePtr(base::android::AttachCurrentThread(), | 53 Java_BlimpContentsImpl_clearNativePtr(base::android::AttachCurrentThread(), |
| 54 java_obj_.obj()); | 54 java_obj_); |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // namespace client | 57 } // namespace client |
| 58 } // namespace blimp | 58 } // namespace blimp |
| OLD | NEW |