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

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

Issue 2121953002: Do not calculate composition bounds until IME requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 5 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 bool ImeAdapterAndroid::RequestTextInputStateUpdate( 321 bool ImeAdapterAndroid::RequestTextInputStateUpdate(
322 JNIEnv* env, 322 JNIEnv* env,
323 const JavaParamRef<jobject>&) { 323 const JavaParamRef<jobject>&) {
324 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); 324 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
325 if (!rwhi) 325 if (!rwhi)
326 return false; 326 return false;
327 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID())); 327 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID()));
328 return true; 328 return true;
329 } 329 }
330 330
331 void ImeAdapterAndroid::RequestCursorUpdate(
332 JNIEnv* env, const base::android::JavaParamRef<jobject>& obj, int mode) {
333 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
334 if (!rwhi)
335 return;
336 rwhi->Send(new InputMsg_RequestCursorUpdate(rwhi->GetRoutingID(), mode));
337 }
338
331 bool ImeAdapterAndroid::IsImeThreadEnabled( 339 bool ImeAdapterAndroid::IsImeThreadEnabled(
332 JNIEnv* env, 340 JNIEnv* env,
333 const base::android::JavaParamRef<jobject>&) { 341 const base::android::JavaParamRef<jobject>&) {
334 return base::FeatureList::IsEnabled(features::kImeThread); 342 return base::FeatureList::IsEnabled(features::kImeThread);
335 } 343 }
336 344
337 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, 345 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env,
338 const JavaParamRef<jobject>&) { 346 const JavaParamRef<jobject>&) {
339 java_ime_adapter_.reset(); 347 java_ime_adapter_.reset();
340 } 348 }
(...skipping 24 matching lines...) Expand all
365 } 373 }
366 374
367 WebContents* ImeAdapterAndroid::GetWebContents() { 375 WebContents* ImeAdapterAndroid::GetWebContents() {
368 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); 376 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl();
369 if (!rwh) 377 if (!rwh)
370 return nullptr; 378 return nullptr;
371 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); 379 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh));
372 } 380 }
373 381
374 } // namespace content 382 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698