| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser/android/content_view_core_impl.h" | 5 #include "content/browser/android/content_view_core_impl.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_array.h" | 8 #include "base/android/jni_array.h" |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 web_contents->SetUserAgentOverride(spoofed_ua); | 249 web_contents->SetUserAgentOverride(spoofed_ua); |
| 250 | 250 |
| 251 java_bridge_dispatcher_host_ = | 251 java_bridge_dispatcher_host_ = |
| 252 new GinJavaBridgeDispatcherHost(web_contents, | 252 new GinJavaBridgeDispatcherHost(web_contents, |
| 253 java_bridge_retained_object_set); | 253 java_bridge_retained_object_set); |
| 254 | 254 |
| 255 InitWebContents(); | 255 InitWebContents(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 ContentViewCoreImpl::~ContentViewCoreImpl() { | 258 ContentViewCoreImpl::~ContentViewCoreImpl() { |
| 259 root_layer_->RemoveFromParent(); |
| 260 |
| 259 JNIEnv* env = base::android::AttachCurrentThread(); | 261 JNIEnv* env = base::android::AttachCurrentThread(); |
| 260 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); | 262 ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env); |
| 261 java_ref_.reset(); | 263 java_ref_.reset(); |
| 262 if (!j_obj.is_null()) { | 264 if (!j_obj.is_null()) { |
| 263 Java_ContentViewCore_onNativeContentViewCoreDestroyed( | 265 Java_ContentViewCore_onNativeContentViewCoreDestroyed( |
| 264 env, j_obj.obj(), reinterpret_cast<intptr_t>(this)); | 266 env, j_obj.obj(), reinterpret_cast<intptr_t>(this)); |
| 265 } | 267 } |
| 266 } | 268 } |
| 267 | 269 |
| 268 base::android::ScopedJavaLocalRef<jobject> | 270 base::android::ScopedJavaLocalRef<jobject> |
| (...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1381 return NULL; | 1383 return NULL; |
| 1382 | 1384 |
| 1383 return view->GetJavaObject().Release(); | 1385 return view->GetJavaObject().Release(); |
| 1384 } | 1386 } |
| 1385 | 1387 |
| 1386 bool RegisterContentViewCore(JNIEnv* env) { | 1388 bool RegisterContentViewCore(JNIEnv* env) { |
| 1387 return RegisterNativesImpl(env); | 1389 return RegisterNativesImpl(env); |
| 1388 } | 1390 } |
| 1389 | 1391 |
| 1390 } // namespace content | 1392 } // namespace content |
| OLD | NEW |