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

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

Issue 2309983002: Allow selection change update before beginBatchEdit (Closed)
Patch Set: fixed a test failure 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 bool ImeAdapterAndroid::RequestTextInputStateUpdate( 291 bool ImeAdapterAndroid::RequestTextInputStateUpdate(
292 JNIEnv* env, 292 JNIEnv* env,
293 const JavaParamRef<jobject>&) { 293 const JavaParamRef<jobject>&) {
294 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); 294 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
295 if (!rwhi) 295 if (!rwhi)
296 return false; 296 return false;
297 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID())); 297 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID()));
298 return true; 298 return true;
299 } 299 }
300 300
301 bool ImeAdapterAndroid::BeginBatchEdit(
302 JNIEnv* env,
303 const JavaParamRef<jobject>&) {
304 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
305 if (!rwhi)
306 return false;
307 rwhi->Send(new InputMsg_ImeBatchEdit(rwhi->GetRoutingID(), true));
308 return true;
309 }
310
311 bool ImeAdapterAndroid::EndBatchEdit(
312 JNIEnv* env,
313 const JavaParamRef<jobject>&) {
314 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
315 if (!rwhi)
316 return false;
317 rwhi->Send(new InputMsg_ImeBatchEdit(rwhi->GetRoutingID(), false));
318 return true;
319 }
320
301 void ImeAdapterAndroid::RequestCursorUpdate( 321 void ImeAdapterAndroid::RequestCursorUpdate(
302 JNIEnv* env, 322 JNIEnv* env,
303 const base::android::JavaParamRef<jobject>& obj, 323 const base::android::JavaParamRef<jobject>& obj,
304 bool immediate_request, 324 bool immediate_request,
305 bool monitor_request) { 325 bool monitor_request) {
306 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); 326 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
307 if (!rwhi) 327 if (!rwhi)
308 return; 328 return;
309 rwhi->Send(new InputMsg_RequestCompositionUpdate( 329 rwhi->Send(new InputMsg_RequestCompositionUpdate(
310 rwhi->GetRoutingID(), immediate_request, monitor_request)); 330 rwhi->GetRoutingID(), immediate_request, monitor_request));
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 367 }
348 368
349 WebContents* ImeAdapterAndroid::GetWebContents() { 369 WebContents* ImeAdapterAndroid::GetWebContents() {
350 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); 370 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl();
351 if (!rwh) 371 if (!rwh)
352 return nullptr; 372 return nullptr;
353 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); 373 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh));
354 } 374 }
355 375
356 } // namespace content 376 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/ime_adapter_android.h ('k') | content/browser/renderer_host/render_widget_host_view_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698