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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
265 } | 265 } |
266 | 266 |
267 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*, jobject, | 267 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*, jobject, |
268 int before, int after) { | 268 int before, int after) { |
269 RenderFrameHostImpl* rfh = | 269 RenderFrameHostImpl* rfh = |
270 static_cast<RenderFrameHostImpl*>(GetFocusedFrame()); | 270 static_cast<RenderFrameHostImpl*>(GetFocusedFrame()); |
271 if (rfh) | 271 if (rfh) |
272 rfh->ExtendSelectionAndDelete(before, after); | 272 rfh->ExtendSelectionAndDelete(before, after); |
273 } | 273 } |
274 | 274 |
275 void ImeAdapterAndroid::RequestTextInputStateUpdate(JNIEnv* env, jobject) { | |
276 RenderWidgetHostImpl* rwhi = GetRenderWidgetHostImpl(); | |
277 if (!rwhi) | |
278 return; | |
aelias_OOO_until_Jul13
2015/09/30 00:10:03
You aren't sending a dummy on this return, so I su
Changwan Ryu
2016/01/19 07:31:52
Done.
| |
279 | |
280 rwhi->Send(new InputMsg_RequestTextInputStateUpdate(rwhi->GetRoutingID())); | |
281 } | |
282 | |
275 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, jobject) { | 283 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, jobject) { |
276 java_ime_adapter_.reset(); | 284 java_ime_adapter_.reset(); |
277 } | 285 } |
278 | 286 |
279 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() { | 287 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() { |
280 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 288 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
281 DCHECK(rwhva_); | 289 DCHECK(rwhva_); |
282 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost(); | 290 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost(); |
283 if (!rwh) | 291 if (!rwh) |
284 return NULL; | 292 return NULL; |
(...skipping 19 matching lines...) Expand all Loading... | |
304 WebContents* ImeAdapterAndroid::GetWebContents() { | 312 WebContents* ImeAdapterAndroid::GetWebContents() { |
305 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); | 313 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); |
306 if (!rwh) | 314 if (!rwh) |
307 return NULL; | 315 return NULL; |
308 if (!rwh->IsRenderView()) | 316 if (!rwh->IsRenderView()) |
309 return NULL; | 317 return NULL; |
310 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); | 318 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); |
311 } | 319 } |
312 | 320 |
313 } // namespace content | 321 } // namespace content |
OLD | NEW |