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

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

Issue 1278593004: Introduce ThreadedInputConnection behind a switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed ImeTest#testDoesNotHang_rendererCrashes which does not test anything Created 4 years, 9 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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*, 283 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*,
284 const JavaParamRef<jobject>&, 284 const JavaParamRef<jobject>&,
285 int before, 285 int before,
286 int after) { 286 int after) {
287 RenderFrameHostImpl* rfh = 287 RenderFrameHostImpl* rfh =
288 static_cast<RenderFrameHostImpl*>(GetFocusedFrame()); 288 static_cast<RenderFrameHostImpl*>(GetFocusedFrame());
289 if (rfh) 289 if (rfh)
290 rfh->ExtendSelectionAndDelete(before, after); 290 rfh->ExtendSelectionAndDelete(before, after);
291 } 291 }
292 292
293 bool ImeAdapterAndroid::RequestTextInputStateUpdate(
294 JNIEnv* env,
295 const JavaParamRef<jobject>&) {
296 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
297 if (!rwhi)
298 return false;
299 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID()));
300 return true;
301 }
302
293 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, 303 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env,
294 const JavaParamRef<jobject>&) { 304 const JavaParamRef<jobject>&) {
295 java_ime_adapter_.reset(); 305 java_ime_adapter_.reset();
296 } 306 }
297 307
298 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() { 308 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() {
299 DCHECK_CURRENTLY_ON(BrowserThread::UI); 309 DCHECK_CURRENTLY_ON(BrowserThread::UI);
300 DCHECK(rwhva_); 310 DCHECK(rwhva_);
301 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost(); 311 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost();
302 if (!rwh) 312 if (!rwh)
(...skipping 18 matching lines...) Expand all
321 } 331 }
322 332
323 WebContents* ImeAdapterAndroid::GetWebContents() { 333 WebContents* ImeAdapterAndroid::GetWebContents() {
324 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); 334 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl();
325 if (!rwh) 335 if (!rwh)
326 return nullptr; 336 return nullptr;
327 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); 337 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh));
328 } 338 }
329 339
330 } // namespace content 340 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698