| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 } | 144 } |
| 145 | 145 |
| 146 RenderWidgetHostViewAndroid* | 146 RenderWidgetHostViewAndroid* |
| 147 ContentViewCoreImpl::GetRenderWidgetHostViewAndroid() { | 147 ContentViewCoreImpl::GetRenderWidgetHostViewAndroid() { |
| 148 RenderWidgetHostView* rwhv = NULL; | 148 RenderWidgetHostView* rwhv = NULL; |
| 149 if (web_contents_) | 149 if (web_contents_) |
| 150 rwhv = web_contents_->GetRenderWidgetHostView(); | 150 rwhv = web_contents_->GetRenderWidgetHostView(); |
| 151 return static_cast<RenderWidgetHostViewAndroid*>(rwhv); | 151 return static_cast<RenderWidgetHostViewAndroid*>(rwhv); |
| 152 } | 152 } |
| 153 | 153 |
| 154 ScopedJavaLocalRef<jobject> ContentViewCoreImpl::GetJavaObject() { |
| 155 JNIEnv* env = AttachCurrentThread(); |
| 156 return java_ref_.get(env); |
| 157 } |
| 158 |
| 154 // ---------------------------------------------------------------------------- | 159 // ---------------------------------------------------------------------------- |
| 155 // Methods called from Java via JNI | 160 // Methods called from Java via JNI |
| 156 // ---------------------------------------------------------------------------- | 161 // ---------------------------------------------------------------------------- |
| 157 | 162 |
| 158 void ContentViewCoreImpl::SelectPopupMenuItems(JNIEnv* env, jobject obj, | 163 void ContentViewCoreImpl::SelectPopupMenuItems(JNIEnv* env, jobject obj, |
| 159 jintArray indices) { | 164 jintArray indices) { |
| 160 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( | 165 RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>( |
| 161 web_contents_->GetRenderViewHost()); | 166 web_contents_->GetRenderViewHost()); |
| 162 DCHECK(rvhi); | 167 DCHECK(rvhi); |
| 163 if (indices == NULL) { | 168 if (indices == NULL) { |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { | 631 if (!HasField(env, clazz, "mNativeContentViewCore", "I")) { |
| 627 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; | 632 DLOG(ERROR) << "Unable to find ContentView.mNativeContentViewCore!"; |
| 628 return false; | 633 return false; |
| 629 } | 634 } |
| 630 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); | 635 g_native_content_view = GetFieldID(env, clazz, "mNativeContentViewCore", "I"); |
| 631 | 636 |
| 632 return RegisterNativesImpl(env) >= 0; | 637 return RegisterNativesImpl(env) >= 0; |
| 633 } | 638 } |
| 634 | 639 |
| 635 } // namespace content | 640 } // namespace content |
| OLD | NEW |