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

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

Issue 2617443002: Implement ThreadedInputConnection.deleteSurroundingTextInCodePoints() (Closed)
Patch Set: Add some DCHECK Created 3 years, 10 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*, 278 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*,
279 const JavaParamRef<jobject>&, 279 const JavaParamRef<jobject>&,
280 int before, 280 int before,
281 int after) { 281 int after) {
282 RenderFrameHostImpl* rfh = 282 RenderFrameHostImpl* rfh =
283 static_cast<RenderFrameHostImpl*>(GetFocusedFrame()); 283 static_cast<RenderFrameHostImpl*>(GetFocusedFrame());
284 if (rfh) 284 if (rfh)
285 rfh->DeleteSurroundingText(before, after); 285 rfh->DeleteSurroundingText(before, after);
286 } 286 }
287 287
288 void ImeAdapterAndroid::DeleteSurroundingTextInCodePoints(
289 JNIEnv*,
290 const JavaParamRef<jobject>&,
291 int before,
292 int after) {
293 RenderFrameHostImpl* rfh =
294 static_cast<RenderFrameHostImpl*>(GetFocusedFrame());
295 if (rfh)
296 rfh->DeleteSurroundingTextInCodePoints(before, after);
297 }
298
288 bool ImeAdapterAndroid::RequestTextInputStateUpdate( 299 bool ImeAdapterAndroid::RequestTextInputStateUpdate(
289 JNIEnv* env, 300 JNIEnv* env,
290 const JavaParamRef<jobject>&) { 301 const JavaParamRef<jobject>&) {
291 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); 302 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl();
292 if (!rwhi) 303 if (!rwhi)
293 return false; 304 return false;
294 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID())); 305 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID()));
295 return true; 306 return true;
296 } 307 }
297 308
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 Java_ImeAdapter_populateUnderlinesFromSpans( 368 Java_ImeAdapter_populateUnderlinesFromSpans(
358 env, obj, text, reinterpret_cast<jlong>(&underlines)); 369 env, obj, text, reinterpret_cast<jlong>(&underlines));
359 370
360 // Sort spans by |.startOffset|. 371 // Sort spans by |.startOffset|.
361 std::sort(underlines.begin(), underlines.end()); 372 std::sort(underlines.begin(), underlines.end());
362 373
363 return underlines; 374 return underlines;
364 } 375 }
365 376
366 } // namespace content 377 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698