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