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

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: Created 5 years, 4 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
« no previous file with comments | « content/browser/renderer_host/ime_adapter_android.h ('k') | content/common/input_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 } 262 }
263 263
264 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*, jobject, 264 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*, jobject,
265 int before, int after) { 265 int before, int after) {
266 RenderFrameHostImpl* rfh = 266 RenderFrameHostImpl* rfh =
267 static_cast<RenderFrameHostImpl*>(GetFocusedFrame()); 267 static_cast<RenderFrameHostImpl*>(GetFocusedFrame());
268 if (rfh) 268 if (rfh)
269 rfh->ExtendSelectionAndDelete(before, after); 269 rfh->ExtendSelectionAndDelete(before, after);
270 } 270 }
271 271
272 void ImeAdapterAndroid::RequestTextInputStateUpdate(JNIEnv* env, jobject) {
273 RenderFrameHost* rfh = GetFocusedFrame();
274 if (!rfh)
275 return;
276
277 rfh->Send(new InputMsg_RequestTextInputStateUpdate(rfh->GetRoutingID()));
278 }
279
272 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, jobject) { 280 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, jobject) {
273 java_ime_adapter_.reset(); 281 java_ime_adapter_.reset();
274 } 282 }
275 283
276 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() { 284 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() {
277 DCHECK_CURRENTLY_ON(BrowserThread::UI); 285 DCHECK_CURRENTLY_ON(BrowserThread::UI);
278 DCHECK(rwhva_); 286 DCHECK(rwhva_);
279 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost(); 287 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost();
280 if (!rwh) 288 if (!rwh)
281 return NULL; 289 return NULL;
(...skipping 19 matching lines...) Expand all
301 WebContents* ImeAdapterAndroid::GetWebContents() { 309 WebContents* ImeAdapterAndroid::GetWebContents() {
302 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); 310 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl();
303 if (!rwh) 311 if (!rwh)
304 return NULL; 312 return NULL;
305 if (!rwh->IsRenderView()) 313 if (!rwh->IsRenderView())
306 return NULL; 314 return NULL;
307 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); 315 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh));
308 } 316 }
309 317
310 } // namespace content 318 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/ime_adapter_android.h ('k') | content/common/input_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698