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

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: fixed release test failures Created 4 years, 11 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 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*, 282 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*,
283 const JavaParamRef<jobject>&, 283 const JavaParamRef<jobject>&,
284 int before, 284 int before,
285 int after) { 285 int after) {
286 RenderFrameHostImpl* rfh = 286 RenderFrameHostImpl* rfh =
287 static_cast<RenderFrameHostImpl*>(GetFocusedFrame()); 287 static_cast<RenderFrameHostImpl*>(GetFocusedFrame());
288 if (rfh) 288 if (rfh)
289 rfh->ExtendSelectionAndDelete(before, after); 289 rfh->ExtendSelectionAndDelete(before, after);
290 } 290 }
291 291
292 void ImeAdapterAndroid::RequestTextInputStateUpdate(
293 JNIEnv* env,
294 const JavaParamRef<jobject>&) {
295 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
296 DCHECK(rwhi);
297 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID()));
298 }
299
292 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, 300 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env,
293 const JavaParamRef<jobject>&) { 301 const JavaParamRef<jobject>&) {
294 java_ime_adapter_.reset(); 302 java_ime_adapter_.reset();
295 } 303 }
296 304
297 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() { 305 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() {
298 DCHECK_CURRENTLY_ON(BrowserThread::UI); 306 DCHECK_CURRENTLY_ON(BrowserThread::UI);
299 DCHECK(rwhva_); 307 DCHECK(rwhva_);
300 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost(); 308 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost();
301 if (!rwh) 309 if (!rwh)
(...skipping 18 matching lines...) Expand all
320 } 328 }
321 329
322 WebContents* ImeAdapterAndroid::GetWebContents() { 330 WebContents* ImeAdapterAndroid::GetWebContents() {
323 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); 331 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl();
324 if (!rwh) 332 if (!rwh)
325 return nullptr; 333 return nullptr;
326 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); 334 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh));
327 } 335 }
328 336
329 } // namespace content 337 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698