Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: content/browser/renderer_host/ime_adapter_android.cc

Issue 56643003: Start using FocusedNodedChanged to restartInput. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: jamesr's nits Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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())
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698