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 <android/input.h> | 7 #include <android/input.h> |
8 | 8 |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 RenderFrameHost* rfh = GetFocusedFrame(); | 256 RenderFrameHost* rfh = GetFocusedFrame(); |
257 if (rfh) | 257 if (rfh) |
258 rfh->Paste(); | 258 rfh->Paste(); |
259 } | 259 } |
260 | 260 |
261 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, jobject) { | 261 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, jobject) { |
262 java_ime_adapter_.reset(); | 262 java_ime_adapter_.reset(); |
263 } | 263 } |
264 | 264 |
265 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() { | 265 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() { |
266 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 266 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
267 DCHECK(rwhva_); | 267 DCHECK(rwhva_); |
268 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost(); | 268 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost(); |
269 if (!rwh) | 269 if (!rwh) |
270 return NULL; | 270 return NULL; |
271 | 271 |
272 return RenderWidgetHostImpl::From(rwh); | 272 return RenderWidgetHostImpl::From(rwh); |
273 } | 273 } |
274 | 274 |
275 RenderFrameHost* ImeAdapterAndroid::GetFocusedFrame() { | 275 RenderFrameHost* ImeAdapterAndroid::GetFocusedFrame() { |
276 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); | 276 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); |
277 if (!rwh) | 277 if (!rwh) |
278 return NULL; | 278 return NULL; |
279 if (!rwh->IsRenderView()) | 279 if (!rwh->IsRenderView()) |
280 return NULL; | 280 return NULL; |
281 RenderViewHost* rvh = RenderViewHost::From(rwh); | 281 RenderViewHost* rvh = RenderViewHost::From(rwh); |
282 FrameTreeNode* focused_frame = | 282 FrameTreeNode* focused_frame = |
283 rvh->GetDelegate()->GetFrameTree()->GetFocusedFrame(); | 283 rvh->GetDelegate()->GetFrameTree()->GetFocusedFrame(); |
284 if (!focused_frame) | 284 if (!focused_frame) |
285 return NULL; | 285 return NULL; |
286 | 286 |
287 return focused_frame->current_frame_host(); | 287 return focused_frame->current_frame_host(); |
288 } | 288 } |
289 | 289 |
290 } // namespace content | 290 } // namespace content |
OLD | NEW |