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 <android/input.h> | 7 #include <android/input.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 java_ime_adapter_ = JavaObjectWeakGlobalRef(env, java_object); | 171 java_ime_adapter_ = JavaObjectWeakGlobalRef(env, java_object); |
172 } | 172 } |
173 | 173 |
174 void ImeAdapterAndroid::CancelComposition() { | 174 void ImeAdapterAndroid::CancelComposition() { |
175 base::android::ScopedJavaLocalRef<jobject> obj = | 175 base::android::ScopedJavaLocalRef<jobject> obj = |
176 java_ime_adapter_.get(AttachCurrentThread()); | 176 java_ime_adapter_.get(AttachCurrentThread()); |
177 if (!obj.is_null()) | 177 if (!obj.is_null()) |
178 Java_ImeAdapter_cancelComposition(AttachCurrentThread(), obj.obj()); | 178 Java_ImeAdapter_cancelComposition(AttachCurrentThread(), obj.obj()); |
179 } | 179 } |
180 | 180 |
181 void ImeAdapterAndroid::FocusedNodeChanged(bool is_editable_node) { | |
182 base::android::ScopedJavaLocalRef<jobject> obj = | |
183 java_ime_adapter_.get(AttachCurrentThread()); | |
184 if (!obj.is_null()) | |
Ted C
2013/11/20 00:52:47
I was under the impression you needed braces if th
Nico
2013/11/20 01:03:10
style nit: If either if condition or statement spa
aurimas (slooooooooow)
2013/11/20 01:12:39
Done.
| |
185 Java_ImeAdapter_focusedNodeChanged(AttachCurrentThread(), | |
186 obj.obj(), | |
187 is_editable_node); | |
188 } | |
189 | |
181 void ImeAdapterAndroid::SetEditableSelectionOffsets(JNIEnv*, jobject, | 190 void ImeAdapterAndroid::SetEditableSelectionOffsets(JNIEnv*, jobject, |
182 int start, int end) { | 191 int start, int end) { |
183 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); | 192 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); |
184 if (!rwhi) | 193 if (!rwhi) |
185 return; | 194 return; |
186 | 195 |
187 rwhi->Send(new ViewMsg_SetEditableSelectionOffsets(rwhi->GetRoutingID(), | 196 rwhi->Send(new ViewMsg_SetEditableSelectionOffsets(rwhi->GetRoutingID(), |
188 start, end)); | 197 start, end)); |
189 } | 198 } |
190 | 199 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
259 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() { | 268 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() { |
260 DCHECK(rwhva_); | 269 DCHECK(rwhva_); |
261 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost(); | 270 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost(); |
262 if (!rwh) | 271 if (!rwh) |
263 return NULL; | 272 return NULL; |
264 | 273 |
265 return RenderWidgetHostImpl::From(rwh); | 274 return RenderWidgetHostImpl::From(rwh); |
266 } | 275 } |
267 | 276 |
268 } // namespace content | 277 } // namespace content |
OLD | NEW |