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

Side by Side 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: Blink ASSERT was missing.. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/frame_host/frame_tree.h" 5 #include "content/browser/frame_host/frame_tree.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <queue> 9 #include <queue>
10 #include <utility> 10 #include <utility>
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 } 244 }
245 245
246 FrameTreeNode* FrameTree::GetFocusedFrame() { 246 FrameTreeNode* FrameTree::GetFocusedFrame() {
247 return FindByID(focused_frame_tree_node_id_); 247 return FindByID(focused_frame_tree_node_id_);
248 } 248 }
249 249
250 void FrameTree::SetFocusedFrame(FrameTreeNode* node, SiteInstance* source) { 250 void FrameTree::SetFocusedFrame(FrameTreeNode* node, SiteInstance* source) {
251 if (node == GetFocusedFrame()) 251 if (node == GetFocusedFrame())
252 return; 252 return;
253 253
254 if (node == nullptr) {
alexmos 2016/05/19 00:08:09 Can you add a comment above this, explaining that
alexmos 2016/05/19 00:08:09 nit: !node
avallee 2016/05/24 20:07:07 Done.
255 if (GetFocusedFrame())
256 GetFocusedFrame()->current_frame_host()->ClearFocusedFrame();
257 focused_frame_tree_node_id_ = FrameTreeNode::kFrameTreeNodeInvalidId;
258
259 // TODO(avallee): https://crbug.com/610795 This line is not sufficient to
260 // make the test pass. There seems to be no focus change events generated.
261 root()->current_frame_host()->UpdateAXTreeData();
alexmos 2016/05/19 00:08:09 Should all three statements in the outer if only h
avallee 2016/05/24 20:07:07 If already nullptr, then: if (node == GetFocusedF
262 return;
263 }
264
254 std::set<SiteInstance*> frame_tree_site_instances = 265 std::set<SiteInstance*> frame_tree_site_instances =
255 CollectSiteInstances(this); 266 CollectSiteInstances(this);
256 267
257 SiteInstance* current_instance = 268 SiteInstance* current_instance =
258 node->current_frame_host()->GetSiteInstance(); 269 node->current_frame_host()->GetSiteInstance();
259 270
260 // Update the focused frame in all other SiteInstances. If focus changes to 271 // Update the focused frame in all other SiteInstances. If focus changes to
261 // a cross-process frame, this allows the old focused frame's renderer 272 // a cross-process frame, this allows the old focused frame's renderer
262 // process to clear focus from that frame and fire blur events. It also 273 // process to clear focus from that frame and fire blur events. It also
263 // ensures that the latest focused frame is available in all renderers to 274 // ensures that the latest focused frame is available in all renderers to
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 // This is only used to set page-level focus in cross-process subframes, and 437 // This is only used to set page-level focus in cross-process subframes, and
427 // requests to set focus in main frame's SiteInstance are ignored. 438 // requests to set focus in main frame's SiteInstance are ignored.
428 if (instance != root_manager->current_frame_host()->GetSiteInstance()) { 439 if (instance != root_manager->current_frame_host()->GetSiteInstance()) {
429 RenderFrameProxyHost* proxy = 440 RenderFrameProxyHost* proxy =
430 root_manager->GetRenderFrameProxyHost(instance); 441 root_manager->GetRenderFrameProxyHost(instance);
431 proxy->Send(new InputMsg_SetFocus(proxy->GetRoutingID(), is_focused)); 442 proxy->Send(new InputMsg_SetFocus(proxy->GetRoutingID(), is_focused));
432 } 443 }
433 } 444 }
434 445
435 } // namespace content 446 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698