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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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; |
299 } | 299 } |
300 | 300 |
301 bool ImeAdapterAndroid::BeginBatchEdit( | |
302 JNIEnv* env, | |
303 const JavaParamRef<jobject>&) { | |
304 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); | |
305 if (!rwhi) | |
306 return false; | |
307 rwhi->Send(new InputMsg_ImeBatchEdit(rwhi->GetRoutingID(), true)); | |
308 return true; | |
309 } | |
310 | |
311 bool ImeAdapterAndroid::EndBatchEdit( | |
312 JNIEnv* env, | |
313 const JavaParamRef<jobject>&) { | |
314 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); | |
315 if (!rwhi) | |
316 return false; | |
317 rwhi->Send(new InputMsg_ImeBatchEdit(rwhi->GetRoutingID(), false)); | |
318 return true; | |
319 } | |
320 | |
321 void ImeAdapterAndroid::RequestCursorUpdate( | 301 void ImeAdapterAndroid::RequestCursorUpdate( |
322 JNIEnv* env, | 302 JNIEnv* env, |
323 const base::android::JavaParamRef<jobject>& obj, | 303 const base::android::JavaParamRef<jobject>& obj, |
324 bool immediate_request, | 304 bool immediate_request, |
325 bool monitor_request) { | 305 bool monitor_request) { |
326 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); | 306 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); |
327 if (!rwhi) | 307 if (!rwhi) |
328 return; | 308 return; |
329 rwhi->Send(new InputMsg_RequestCompositionUpdate( | 309 rwhi->Send(new InputMsg_RequestCompositionUpdate( |
330 rwhi->GetRoutingID(), immediate_request, monitor_request)); | 310 rwhi->GetRoutingID(), immediate_request, monitor_request)); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 } | 347 } |
368 | 348 |
369 WebContents* ImeAdapterAndroid::GetWebContents() { | 349 WebContents* ImeAdapterAndroid::GetWebContents() { |
370 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); | 350 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); |
371 if (!rwh) | 351 if (!rwh) |
372 return nullptr; | 352 return nullptr; |
373 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); | 353 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); |
374 } | 354 } |
375 | 355 |
376 } // namespace content | 356 } // namespace content |
OLD | NEW |