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

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

Issue 2617443002: Implement ThreadedInputConnection.deleteSurroundingTextInCodePoints() (Closed)
Patch Set: Add more comments Created 3 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*, 279 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*,
280 const JavaParamRef<jobject>&, 280 const JavaParamRef<jobject>&,
281 int before, 281 int before,
282 int after) { 282 int after) {
283 RenderFrameHostImpl* rfh = 283 RenderFrameHostImpl* rfh =
284 static_cast<RenderFrameHostImpl*>(GetFocusedFrame()); 284 static_cast<RenderFrameHostImpl*>(GetFocusedFrame());
285 if (rfh) 285 if (rfh)
286 rfh->DeleteSurroundingText(before, after); 286 rfh->DeleteSurroundingText(before, after);
287 } 287 }
288 288
289 void ImeAdapterAndroid::DeleteSurroundingTextInCodePoints(
290 JNIEnv*,
291 const JavaParamRef<jobject>&,
292 int before,
293 int after) {
294 RenderFrameHostImpl* rfh =
295 static_cast<RenderFrameHostImpl*>(GetFocusedFrame());
296 if (rfh)
297 rfh->DeleteSurroundingTextInCodePoints(before, after);
298 }
299
289 bool ImeAdapterAndroid::RequestTextInputStateUpdate( 300 bool ImeAdapterAndroid::RequestTextInputStateUpdate(
290 JNIEnv* env, 301 JNIEnv* env,
291 const JavaParamRef<jobject>&) { 302 const JavaParamRef<jobject>&) {
292 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); 303 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
293 if (!rwhi) 304 if (!rwhi)
294 return false; 305 return false;
295 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID())); 306 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID()));
296 return true; 307 return true;
297 } 308 }
298 309
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 } 350 }
340 351
341 WebContents* ImeAdapterAndroid::GetWebContents() { 352 WebContents* ImeAdapterAndroid::GetWebContents() {
342 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); 353 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl();
343 if (!rwh) 354 if (!rwh)
344 return nullptr; 355 return nullptr;
345 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); 356 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh));
346 } 357 }
347 358
348 } // namespace content 359 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698