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

Unified Diff: content/browser/web_contents/web_contents_view_android.cc

Issue 2485763003: Remove access to WebContents in RWHVA::Focus() (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_android.cc
diff --git a/content/browser/web_contents/web_contents_view_android.cc b/content/browser/web_contents/web_contents_view_android.cc
index e3b9d4ad53631b2a91caa1b4e1aa2bd54264310e..8a55bfe3d7c88ff906f1b8f916ace33ca861320c 100644
--- a/content/browser/web_contents/web_contents_view_android.cc
+++ b/content/browser/web_contents/web_contents_view_android.cc
@@ -129,10 +129,15 @@ void WebContentsViewAndroid::SizeContents(const gfx::Size& size) {
}
void WebContentsViewAndroid::Focus() {
- if (web_contents_->ShowingInterstitialPage())
+ RenderWidgetHostViewAndroid* rwhv = static_cast<RenderWidgetHostViewAndroid*>(
+ web_contents_->GetRenderWidgetHostView());
+ if (web_contents_->ShowingInterstitialPage()) {
web_contents_->GetInterstitialPage()->Focus();
- else
- web_contents_->GetRenderWidgetHostView()->Focus();
+ if (content_view_core_)
+ content_view_core_->ForceUpdateImeAdapter(rwhv->GetNativeImeAdapter());
+ } else {
+ rwhv->Focus();
+ }
}
void WebContentsViewAndroid::SetInitialFocus() {
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698