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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 } | 262 } |
263 | 263 |
264 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*, jobject, | 264 void ImeAdapterAndroid::DeleteSurroundingText(JNIEnv*, jobject, |
265 int before, int after) { | 265 int before, int after) { |
266 RenderFrameHostImpl* rfh = | 266 RenderFrameHostImpl* rfh = |
267 static_cast<RenderFrameHostImpl*>(GetFocusedFrame()); | 267 static_cast<RenderFrameHostImpl*>(GetFocusedFrame()); |
268 if (rfh) | 268 if (rfh) |
269 rfh->ExtendSelectionAndDelete(before, after); | 269 rfh->ExtendSelectionAndDelete(before, after); |
270 } | 270 } |
271 | 271 |
| 272 void ImeAdapterAndroid::RequestTextInputStateUpdate(JNIEnv* env, jobject) { |
| 273 RenderFrameHost* rfh = GetFocusedFrame(); |
| 274 if (!rfh) |
| 275 return; |
| 276 |
| 277 rfh->Send(new InputMsg_RequestTextInputStateUpdate(rfh->GetRoutingID())); |
| 278 } |
| 279 |
272 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, jobject) { | 280 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, jobject) { |
273 java_ime_adapter_.reset(); | 281 java_ime_adapter_.reset(); |
274 } | 282 } |
275 | 283 |
276 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() { | 284 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() { |
277 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 285 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
278 DCHECK(rwhva_); | 286 DCHECK(rwhva_); |
279 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost(); | 287 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost(); |
280 if (!rwh) | 288 if (!rwh) |
281 return NULL; | 289 return NULL; |
(...skipping 19 matching lines...) Expand all Loading... |
301 WebContents* ImeAdapterAndroid::GetWebContents() { | 309 WebContents* ImeAdapterAndroid::GetWebContents() { |
302 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); | 310 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); |
303 if (!rwh) | 311 if (!rwh) |
304 return NULL; | 312 return NULL; |
305 if (!rwh->IsRenderView()) | 313 if (!rwh->IsRenderView()) |
306 return NULL; | 314 return NULL; |
307 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); | 315 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); |
308 } | 316 } |
309 | 317 |
310 } // namespace content | 318 } // namespace content |
OLD | NEW |