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

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

Issue 2309983002: Allow selection change update before beginBatchEdit (Closed)
Patch Set: polish up a bit Created 4 years, 3 months 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
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 <algorithm> 7 #include <algorithm>
8 #include <android/input.h> 8 #include <android/input.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 bool ImeAdapterAndroid::RequestTextInputStateUpdate( 282 bool ImeAdapterAndroid::RequestTextInputStateUpdate(
283 JNIEnv* env, 283 JNIEnv* env,
284 const JavaParamRef<jobject>&) { 284 const JavaParamRef<jobject>&) {
285 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); 285 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
286 if (!rwhi) 286 if (!rwhi)
287 return false; 287 return false;
288 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID())); 288 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID()));
289 return true; 289 return true;
290 } 290 }
291 291
292 bool ImeAdapterAndroid::BeginBatchEdit(
293 JNIEnv* env,
294 const JavaParamRef<jobject>&) {
295 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
296 if (!rwhi)
297 return false;
298 rwhi->Send(new InputMsg_ImeBatchEdit(rwhi->GetRoutingID(), true));
299 return true;
300 }
301
302 bool ImeAdapterAndroid::EndBatchEdit(
303 JNIEnv* env,
304 const JavaParamRef<jobject>&) {
305 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
306 if (!rwhi)
307 return false;
308 rwhi->Send(new InputMsg_ImeBatchEdit(rwhi->GetRoutingID(), false));
309 return true;
310 }
311
292 void ImeAdapterAndroid::RequestCursorUpdate( 312 void ImeAdapterAndroid::RequestCursorUpdate(
293 JNIEnv* env, 313 JNIEnv* env,
294 const base::android::JavaParamRef<jobject>& obj, 314 const base::android::JavaParamRef<jobject>& obj,
295 bool immediate_request, 315 bool immediate_request,
296 bool monitor_request) { 316 bool monitor_request) {
297 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); 317 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
298 if (!rwhi) 318 if (!rwhi)
299 return; 319 return;
300 rwhi->Send(new InputMsg_RequestCompositionUpdate( 320 rwhi->Send(new InputMsg_RequestCompositionUpdate(
301 rwhi->GetRoutingID(), immediate_request, monitor_request)); 321 rwhi->GetRoutingID(), immediate_request, monitor_request));
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 } 358 }
339 359
340 WebContents* ImeAdapterAndroid::GetWebContents() { 360 WebContents* ImeAdapterAndroid::GetWebContents() {
341 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); 361 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl();
342 if (!rwh) 362 if (!rwh)
343 return nullptr; 363 return nullptr;
344 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); 364 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh));
345 } 365 }
346 366
347 } // namespace content 367 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698