OLD | NEW |
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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 rfh->GetRoutingID(), start, end, underlines)); | 309 rfh->GetRoutingID(), start, end, underlines)); |
310 } | 310 } |
311 | 311 |
312 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*, | 312 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*, |
313 const JavaParamRef<jobject>&, | 313 const JavaParamRef<jobject>&, |
314 int before, | 314 int before, |
315 int after) { | 315 int after) { |
316 RenderFrameHostImpl* rfh = | 316 RenderFrameHostImpl* rfh = |
317 static_cast<RenderFrameHostImpl*>(GetFocusedFrame()); | 317 static_cast<RenderFrameHostImpl*>(GetFocusedFrame()); |
318 if (rfh) | 318 if (rfh) |
319 rfh->ExtendSelectionAndDelete(before, after); | 319 rfh->DeleteSurroundingText(before, after); |
320 } | 320 } |
321 | 321 |
322 bool ImeAdapterAndroid::RequestTextInputStateUpdate( | 322 bool ImeAdapterAndroid::RequestTextInputStateUpdate( |
323 JNIEnv* env, | 323 JNIEnv* env, |
324 const JavaParamRef<jobject>&) { | 324 const JavaParamRef<jobject>&) { |
325 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); | 325 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); |
326 if (!rwhi) | 326 if (!rwhi) |
327 return false; | 327 return false; |
328 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID())); | 328 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID())); |
329 return true; | 329 return true; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 } | 366 } |
367 | 367 |
368 WebContents* ImeAdapterAndroid::GetWebContents() { | 368 WebContents* ImeAdapterAndroid::GetWebContents() { |
369 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); | 369 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); |
370 if (!rwh) | 370 if (!rwh) |
371 return nullptr; | 371 return nullptr; |
372 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); | 372 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); |
373 } | 373 } |
374 | 374 |
375 } // namespace content | 375 } // namespace content |
OLD | NEW |