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

Unified Diff: content/browser/frame_host/frame_tree.cc

Issue 1934703002: Fix keyboard focus for OOPIF-<webview>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Fix tab focus change. Created 4 years, 7 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/frame_host/frame_tree.cc
diff --git a/content/browser/frame_host/frame_tree.cc b/content/browser/frame_host/frame_tree.cc
index 9977976aaba40eb87ec1c970367ba9b3f85a4053..979253d31629b7a8cc6f9aba9cf07149d5db7b51 100644
--- a/content/browser/frame_host/frame_tree.cc
+++ b/content/browser/frame_host/frame_tree.cc
@@ -251,6 +251,17 @@ void FrameTree::SetFocusedFrame(FrameTreeNode* node, SiteInstance* source) {
if (node == GetFocusedFrame())
return;
+ if (node == nullptr) {
+ if (GetFocusedFrame())
+ GetFocusedFrame()->current_frame_host()->UnsetFocusedFrame();
alexmos 2016/05/12 20:28:39 Do proxies need to be notified also? E.g., suppos
avallee 2016/05/16 20:26:43 Agreed that they would need to be notified. Howev
alexmos 2016/05/19 00:08:08 I brought this up on site isolation chat, and inde
+ focused_frame_tree_node_id_ = FrameTreeNode::kFrameTreeNodeInvalidId;
+
+ // TODO(avallee): https://crbug.com/610795 This line is not sufficient to
dmazzoni 2016/05/12 02:58:56 I'm okay with landing this change as-is and fixing
avallee 2016/05/16 20:26:41 Thanks for the follow up dmazzoni. I have an idea
+ // make the test pass. There seems to be no focus change events generated.
+ root()->current_frame_host()->UpdateAXTreeData();
+ return;
+ }
+
std::set<SiteInstance*> frame_tree_site_instances =
CollectSiteInstances(this);
@@ -272,13 +283,14 @@ void FrameTree::SetFocusedFrame(FrameTreeNode* node, SiteInstance* source) {
DCHECK(SiteIsolationPolicy::AreCrossProcessFramesPossible());
RenderFrameProxyHost* proxy =
node->render_manager()->GetRenderFrameProxyHost(instance);
- proxy->SetFocusedFrame();
+ if (proxy)
alexmos 2016/05/12 20:28:39 Why is adding this check necessary?
avallee 2016/05/16 20:26:41 I don't think this is necessary anymore, but was i
+ proxy->SetFocusedFrame();
}
}
// If |node| was focused from a cross-process frame (i.e., via
// window.focus()), tell its RenderFrame that it should focus.
- if (current_instance != source)
+ if (current_instance && current_instance != source)
alexmos 2016/05/12 20:28:39 Similar question here. I can't see how this can b
avallee 2016/05/16 20:26:41 Removed.
node->current_frame_host()->SetFocusedFrame();
focused_frame_tree_node_id_ = node->frame_tree_node_id();

Powered by Google App Engine
This is Rietveld 408576698