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

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

Issue 2208093004: Use focused RenderWidgetHostImpl instead of TextInputManager::GetActiveWidget() to obtain TextSelec… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed some crashes Created 4 years, 4 months 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
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 19d9d26bb515dabebf7fc2b03b581dc393474d66..7d944bf322effa6e7636d177a539815e4303d7dd 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1823,6 +1823,12 @@ void WebContentsImpl::ReplicatePageFocus(bool is_focused) {
RenderWidgetHostImpl* WebContentsImpl::GetFocusedRenderWidgetHost(
RenderWidgetHostImpl* receiving_widget) {
+ if (!receiving_widget)
+ receiving_widget = GetMainFrame()->GetRenderWidgetHost();
+
+ if (!receiving_widget)
+ return nullptr;
+
if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
return receiving_widget;

Powered by Google App Engine
This is Rietveld 408576698