| 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 if (wc) | 292 if (wc) |
| 293 wc->Copy(); | 293 wc->Copy(); |
| 294 } | 294 } |
| 295 | 295 |
| 296 void ImeAdapterAndroid::Paste(JNIEnv* env, jobject) { | 296 void ImeAdapterAndroid::Paste(JNIEnv* env, jobject) { |
| 297 WebContents* wc = GetWebContents(); | 297 WebContents* wc = GetWebContents(); |
| 298 if (wc) | 298 if (wc) |
| 299 wc->Paste(); | 299 wc->Paste(); |
| 300 } | 300 } |
| 301 | 301 |
| 302 void ImeAdapterAndroid::AdvanceFocusToNextInputField(JNIEnv* env, |
| 303 jobject obj, |
| 304 jboolean direction) { |
| 305 WebContents* web_contents = GetWebContents(); |
| 306 if (!web_contents) |
| 307 return; |
| 308 web_contents->AdvanceFocusToNextInputField(direction); |
| 309 } |
| 310 |
| 302 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, jobject) { | 311 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, jobject) { |
| 303 java_ime_adapter_.reset(); | 312 java_ime_adapter_.reset(); |
| 304 } | 313 } |
| 305 | 314 |
| 306 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() { | 315 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() { |
| 307 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 316 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 308 DCHECK(rwhva_); | 317 DCHECK(rwhva_); |
| 309 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost(); | 318 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost(); |
| 310 if (!rwh) | 319 if (!rwh) |
| 311 return NULL; | 320 return NULL; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 331 WebContents* ImeAdapterAndroid::GetWebContents() { | 340 WebContents* ImeAdapterAndroid::GetWebContents() { |
| 332 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); | 341 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); |
| 333 if (!rwh) | 342 if (!rwh) |
| 334 return NULL; | 343 return NULL; |
| 335 if (!rwh->IsRenderView()) | 344 if (!rwh->IsRenderView()) |
| 336 return NULL; | 345 return NULL; |
| 337 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); | 346 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); |
| 338 } | 347 } |
| 339 | 348 |
| 340 } // namespace content | 349 } // namespace content |
| OLD | NEW |