Chromium Code Reviews| 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/renderer_host/ime_adapter_android.h" | 5 #include "content/browser/renderer_host/ime_adapter_android.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <android/input.h> | 8 #include <android/input.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 220 java_ime_adapter_ = JavaObjectWeakGlobalRef(env, java_object); | 220 java_ime_adapter_ = JavaObjectWeakGlobalRef(env, java_object); |
| 221 } | 221 } |
| 222 | 222 |
| 223 void ImeAdapterAndroid::CancelComposition() { | 223 void ImeAdapterAndroid::CancelComposition() { |
| 224 base::android::ScopedJavaLocalRef<jobject> obj = | 224 base::android::ScopedJavaLocalRef<jobject> obj = |
| 225 java_ime_adapter_.get(AttachCurrentThread()); | 225 java_ime_adapter_.get(AttachCurrentThread()); |
| 226 if (!obj.is_null()) | 226 if (!obj.is_null()) |
| 227 Java_ImeAdapter_cancelComposition(AttachCurrentThread(), obj.obj()); | 227 Java_ImeAdapter_cancelComposition(AttachCurrentThread(), obj.obj()); |
| 228 } | 228 } |
| 229 | 229 |
| 230 bool ImeAdapterAndroid::HasComposition() { | |
|
jdduke (slow)
2015/03/18 19:50:08
Would it be worth simply moving all the FinishComp
| |
| 231 base::android::ScopedJavaLocalRef<jobject> obj = | |
| 232 java_ime_adapter_.get(AttachCurrentThread()); | |
| 233 if (!obj.is_null()) | |
| 234 return Java_ImeAdapter_hasComposition(AttachCurrentThread(), obj.obj()); | |
| 235 return false; | |
| 236 } | |
| 237 | |
| 230 void ImeAdapterAndroid::FocusedNodeChanged(bool is_editable_node) { | 238 void ImeAdapterAndroid::FocusedNodeChanged(bool is_editable_node) { |
| 231 base::android::ScopedJavaLocalRef<jobject> obj = | 239 base::android::ScopedJavaLocalRef<jobject> obj = |
| 232 java_ime_adapter_.get(AttachCurrentThread()); | 240 java_ime_adapter_.get(AttachCurrentThread()); |
| 233 if (!obj.is_null()) { | 241 if (!obj.is_null()) { |
| 234 Java_ImeAdapter_focusedNodeChanged(AttachCurrentThread(), | 242 Java_ImeAdapter_focusedNodeChanged(AttachCurrentThread(), |
| 235 obj.obj(), | 243 obj.obj(), |
| 236 is_editable_node); | 244 is_editable_node); |
| 237 } | 245 } |
| 238 } | 246 } |
| 239 | 247 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 WebContents* ImeAdapterAndroid::GetWebContents() { | 339 WebContents* ImeAdapterAndroid::GetWebContents() { |
| 332 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); | 340 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); |
| 333 if (!rwh) | 341 if (!rwh) |
| 334 return NULL; | 342 return NULL; |
| 335 if (!rwh->IsRenderView()) | 343 if (!rwh->IsRenderView()) |
| 336 return NULL; | 344 return NULL; |
| 337 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); | 345 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); |
| 338 } | 346 } |
| 339 | 347 |
| 340 } // namespace content | 348 } // namespace content |
| OLD | NEW |