| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } | 156 } |
| 157 | 157 |
| 158 RenderWidgetHostViewAndroid* | 158 RenderWidgetHostViewAndroid* |
| 159 ContentViewCoreImpl::GetRenderWidgetHostViewAndroid() { | 159 ContentViewCoreImpl::GetRenderWidgetHostViewAndroid() { |
| 160 RenderWidgetHostView* rwhv = NULL; | 160 RenderWidgetHostView* rwhv = NULL; |
| 161 if (web_contents_) | 161 if (web_contents_) |
| 162 rwhv = web_contents_->GetRenderWidgetHostView(); | 162 rwhv = web_contents_->GetRenderWidgetHostView(); |
| 163 return static_cast<RenderWidgetHostViewAndroid*>(rwhv); | 163 return static_cast<RenderWidgetHostViewAndroid*>(rwhv); |
| 164 } | 164 } |
| 165 | 165 |
| 166 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetJavaObject() { |
| 167 JNIEnv* env = AttachCurrentThread(); |
| 168 return java_ref_.get(env); |
| 169 } |
| 170 |
| 166 // ---------------------------------------------------------------------------- | 171 // ---------------------------------------------------------------------------- |
| 167 // Methods called from Java via JNI | 172 // Methods called from Java via JNI |
| 168 // ---------------------------------------------------------------------------- | 173 // ---------------------------------------------------------------------------- |
| 169 | 174 |
| 170 void ContentViewCoreImpl::SelectPopupMenuItems(JNIEnv* env, jobject obj, | 175 void ContentViewCoreImpl::SelectPopupMenuItems(JNIEnv* env, jobject obj, |
| 171 jintArray indices) { | 176 jintArray indices) { |
| 172 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( | 177 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( |
| 173 web_contents_->GetRenderViewHost()); | 178 web_contents_->GetRenderViewHost()); |
| 174 DCHECK(rvhi); | 179 DCHECK(rvhi); |
| 175 if (indices == NULL) { | 180 if (indices == NULL) { |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 633 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { |
| 629 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 634 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; |
| 630 return false; | 635 return false; |
| 631 } | 636 } |
| 632 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 637 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); |
| 633 | 638 |
| 634 return RegisterNativesImpl(env) >= 0; | 639 return RegisterNativesImpl(env) >= 0; |
| 635 } | 640 } |
| 636 | 641 |
| 637 } // namespace content | 642 } // namespace content |
| OLD | NEW |