Chromium Code Reviews| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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; |
| 329 } | 329 } |
| 330 | 330 |
| 331 void ImeAdapterAndroid::RequestCursorUpdate( | |
| 332 JNIEnv* env, const base::android::JavaParamRef<jobject>& obj, int mode) { | |
| 333 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); | |
| 334 if (rwhi) | |
|
yosin_UTC9
2016/07/06 02:02:01
nit: better to use early return style
if (!rwhi)
Seigo Nonaka
2016/07/06 03:25:56
Done.
| |
| 335 rwhi->Send(new InputMsg_RequestCursorUpdate(rwhi->GetRoutingID(), mode)); | |
| 336 } | |
| 337 | |
| 331 bool ImeAdapterAndroid::IsImeThreadEnabled( | 338 bool ImeAdapterAndroid::IsImeThreadEnabled( |
| 332 JNIEnv* env, | 339 JNIEnv* env, |
| 333 const base::android::JavaParamRef<jobject>&) { | 340 const base::android::JavaParamRef<jobject>&) { |
| 334 return base::FeatureList::IsEnabled(features::kImeThread); | 341 return base::FeatureList::IsEnabled(features::kImeThread); |
| 335 } | 342 } |
| 336 | 343 |
| 337 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, | 344 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, |
| 338 const JavaParamRef<jobject>&) { | 345 const JavaParamRef<jobject>&) { |
| 339 java_ime_adapter_.reset(); | 346 java_ime_adapter_.reset(); |
| 340 } | 347 } |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 365 } | 372 } |
| 366 | 373 |
| 367 WebContents* ImeAdapterAndroid::GetWebContents() { | 374 WebContents* ImeAdapterAndroid::GetWebContents() { |
| 368 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); | 375 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); |
| 369 if (!rwh) | 376 if (!rwh) |
| 370 return nullptr; | 377 return nullptr; |
| 371 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); | 378 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); |
| 372 } | 379 } |
| 373 | 380 |
| 374 } // namespace content | 381 } // namespace content |
| OLD | NEW |