Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: content/browser/renderer_host/ime_adapter_android.cc

Issue 1411203010: Separate RenderViewHost from RenderWidgetHost, part 4: delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: oops Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 274
275 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, jobject) { 275 void ImeAdapterAndroid::ResetImeAdapter(JNIEnv* env, jobject) {
276 java_ime_adapter_.reset(); 276 java_ime_adapter_.reset();
277 } 277 }
278 278
279 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() { 279 RenderWidgetHostImpl* ImeAdapterAndroid::GetRenderWidgetHostImpl() {
280 DCHECK_CURRENTLY_ON(BrowserThread::UI); 280 DCHECK_CURRENTLY_ON(BrowserThread::UI);
281 DCHECK(rwhva_); 281 DCHECK(rwhva_);
282 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost(); 282 RenderWidgetHost* rwh = rwhva_->GetRenderWidgetHost();
283 if (!rwh) 283 if (!rwh)
284 return NULL; 284 return nullptr;
285 285
286 return RenderWidgetHostImpl::From(rwh); 286 return RenderWidgetHostImpl::From(rwh);
287 } 287 }
288 288
289 RenderFrameHost* ImeAdapterAndroid::GetFocusedFrame() { 289 RenderFrameHost* ImeAdapterAndroid::GetFocusedFrame() {
290 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); 290 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl();
291 if (!rwh) 291 if (!rwh)
292 return NULL; 292 return nullptr;
293 if (!rwh->IsRenderView())
294 return NULL;
295 RenderViewHost* rvh = RenderViewHost::From(rwh); 293 RenderViewHost* rvh = RenderViewHost::From(rwh);
294 if (!rvh)
295 return nullptr;
296 FrameTreeNode* focused_frame = 296 FrameTreeNode* focused_frame =
297 rvh->GetDelegate()->GetFrameTree()->GetFocusedFrame(); 297 rvh->GetDelegate()->GetFrameTree()->GetFocusedFrame();
298 if (!focused_frame) 298 if (!focused_frame)
299 return NULL; 299 return nullptr;
300 300
301 return focused_frame->current_frame_host(); 301 return focused_frame->current_frame_host();
302 } 302 }
303 303
304 WebContents* ImeAdapterAndroid::GetWebContents() { 304 WebContents* ImeAdapterAndroid::GetWebContents() {
305 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl(); 305 RenderWidgetHostImpl* rwh = GetRenderWidgetHostImpl();
306 if (!rwh) 306 if (!rwh)
307 return NULL; 307 return nullptr;
308 if (!rwh->IsRenderView())
309 return NULL;
310 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh)); 308 return WebContents::FromRenderViewHost(RenderViewHost::From(rwh));
311 } 309 }
312 310
313 } // namespace content 311 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698