| 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 "android_webview/native/aw_contents.h" | 5 #include "android_webview/native/aw_contents.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" | 7 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" |
| 8 #include "android_webview/native/aw_browser_dependency_factory.h" | 8 #include "android_webview/native/aw_browser_dependency_factory.h" |
| 9 #include "android_webview/native/aw_contents_container.h" | 9 #include "android_webview/native/aw_contents_container.h" |
| 10 #include "android_webview/native/aw_web_contents_delegate.h" | 10 #include "android_webview/native/aw_web_contents_delegate.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 } | 80 } |
| 81 | 81 |
| 82 jint AwContents::GetWebContents(JNIEnv* env, jobject obj) { | 82 jint AwContents::GetWebContents(JNIEnv* env, jobject obj) { |
| 83 return reinterpret_cast<jint>(contents_container_->GetWebContents()); | 83 return reinterpret_cast<jint>(contents_container_->GetWebContents()); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void AwContents::Destroy(JNIEnv* env, jobject obj) { | 86 void AwContents::Destroy(JNIEnv* env, jobject obj) { |
| 87 delete this; | 87 delete this; |
| 88 } | 88 } |
| 89 | 89 |
| 90 AwWebContentsDelegate* AwContents::GetAwWebContentsDelegate() const { |
| 91 return web_contents_delegate_.get(); |
| 92 } |
| 93 |
| 90 namespace { | 94 namespace { |
| 91 // |message| is passed as base::Owned, so it will automatically be deleted | 95 // |message| is passed as base::Owned, so it will automatically be deleted |
| 92 // when the callback goes out of scope. | 96 // when the callback goes out of scope. |
| 93 void DocumentHasImagesCallback(ScopedJavaGlobalRef<jobject>* message, | 97 void DocumentHasImagesCallback(ScopedJavaGlobalRef<jobject>* message, |
| 94 bool has_images) { | 98 bool has_images) { |
| 95 Java_AwContents_onDocumentHasImagesResponse(AttachCurrentThread(), | 99 Java_AwContents_onDocumentHasImagesResponse(AttachCurrentThread(), |
| 96 has_images, | 100 has_images, |
| 97 message->obj()); | 101 message->obj()); |
| 98 } | 102 } |
| 99 } // namespace | 103 } // namespace |
| (...skipping 25 matching lines...) Expand all Loading... |
| 125 private_browsing); | 129 private_browsing); |
| 126 return reinterpret_cast<jint>(tab); | 130 return reinterpret_cast<jint>(tab); |
| 127 } | 131 } |
| 128 | 132 |
| 129 bool RegisterAwContents(JNIEnv* env) { | 133 bool RegisterAwContents(JNIEnv* env) { |
| 130 return RegisterNativesImpl(env) >= 0; | 134 return RegisterNativesImpl(env) >= 0; |
| 131 } | 135 } |
| 132 | 136 |
| 133 | 137 |
| 134 } // namespace android_webview | 138 } // namespace android_webview |
| OLD | NEW |