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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 rfh->GetRoutingID(), start, end, underlines)); | 278 rfh->GetRoutingID(), start, end, underlines)); |
279 } | 279 } |
280 | 280 |
281 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*, | 281 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*, |
282 const JavaParamRef<jobject>&, | 282 const JavaParamRef<jobject>&, |
283 int before, | 283 int before, |
284 int after) { | 284 int after) { |
285 RenderFrameHostImpl* rfh = | 285 RenderFrameHostImpl* rfh = |
286 static_cast<RenderFrameHostImpl*>(GetFocusedFrame()); | 286 static_cast<RenderFrameHostImpl*>(GetFocusedFrame()); |
287 if (rfh) | 287 if (rfh) |
288 rfh->ExtendSelectionAndDelete(before, after); | 288 rfh->DeleteSurroundingText(before, after); |
289 } | 289 } |
290 | 290 |
291 bool ImeAdapterAndroid::RequestTextInputStateUpdate( | 291 bool ImeAdapterAndroid::RequestTextInputStateUpdate( |
292 JNIEnv* env, | 292 JNIEnv* env, |
293 const JavaParamRef<jobject>&) { | 293 const JavaParamRef<jobject>&) { |
294 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); | 294 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); |
295 if (!rwhi) | 295 if (!rwhi) |
296 return false; | 296 return false; |
297 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID())); | 297 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID())); |
298 return true; | 298 return true; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 } | 367 } |
368 | 368 |
369 WebContents* ImeAdapterAndroid::GetWebContents() { | 369 WebContents* ImeAdapterAndroid::GetWebContents() { |
370 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); | 370 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); |
371 if (!rwh) | 371 if (!rwh) |
372 return nullptr; | 372 return nullptr; |
373 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); | 373 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); |
374 } | 374 } |
375 | 375 |
376 } // namespace content | 376 } // namespace content |
OLD | NEW |