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 "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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 | 247 |
248 ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetTitle( | 248 ScopedJavaLocalRef<jstring> ContentViewCoreImpl::GetTitle( |
249 JNIEnv* env, jobject obj) const { | 249 JNIEnv* env, jobject obj) const { |
250 return ConvertUTF16ToJavaString(env, web_contents()->GetTitle()); | 250 return ConvertUTF16ToJavaString(env, web_contents()->GetTitle()); |
251 } | 251 } |
252 | 252 |
253 jboolean ContentViewCoreImpl::IsIncognito(JNIEnv* env, jobject obj) { | 253 jboolean ContentViewCoreImpl::IsIncognito(JNIEnv* env, jobject obj) { |
254 return web_contents()->GetBrowserContext()->IsOffTheRecord(); | 254 return web_contents()->GetBrowserContext()->IsOffTheRecord(); |
255 } | 255 } |
256 | 256 |
| 257 WebContents* ContentViewCoreImpl::web_contents() const { |
| 258 return web_contents_; |
| 259 } |
| 260 |
257 jboolean ContentViewCoreImpl::TouchEvent(JNIEnv* env, | 261 jboolean ContentViewCoreImpl::TouchEvent(JNIEnv* env, |
258 jobject obj, | 262 jobject obj, |
259 jlong time_ms, | 263 jlong time_ms, |
260 jint type, | 264 jint type, |
261 jobjectArray pts) { | 265 jobjectArray pts) { |
262 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); | 266 RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); |
263 if (rwhv) { | 267 if (rwhv) { |
264 using WebKit::WebTouchEvent; | 268 using WebKit::WebTouchEvent; |
265 WebKit::WebTouchEvent event; | 269 WebKit::WebTouchEvent event; |
266 TouchPoint::BuildWebTouchEvent(env, type, time_ms, pts, event); | 270 TouchPoint::BuildWebTouchEvent(env, type, time_ms, pts, event); |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 710 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { |
707 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 711 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; |
708 return false; | 712 return false; |
709 } | 713 } |
710 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 714 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); |
711 | 715 |
712 return RegisterNativesImpl(env) >= 0; | 716 return RegisterNativesImpl(env) >= 0; |
713 } | 717 } |
714 | 718 |
715 } // namespace content | 719 } // namespace content |
OLD | NEW |