| OLD | NEW |
| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 } | 257 } |
| 258 | 258 |
| 259 FrameTreeNode* FrameTree::GetFocusedFrame() { | 259 FrameTreeNode* FrameTree::GetFocusedFrame() { |
| 260 return FindByID(focused_frame_tree_node_id_); | 260 return FindByID(focused_frame_tree_node_id_); |
| 261 } | 261 } |
| 262 | 262 |
| 263 void FrameTree::SetFocusedFrame(FrameTreeNode* node, SiteInstance* source) { | 263 void FrameTree::SetFocusedFrame(FrameTreeNode* node, SiteInstance* source) { |
| 264 if (node == GetFocusedFrame()) | 264 if (node == GetFocusedFrame()) |
| 265 return; | 265 return; |
| 266 | 266 |
| 267 if (!node) { | |
| 268 // TODO(avallee): https://crbug.com/614463 Notify proxies here once | |
| 269 // <webview> supports oopifs inside itself. | |
| 270 if (GetFocusedFrame()) | |
| 271 GetFocusedFrame()->current_frame_host()->ClearFocusedFrame(); | |
| 272 focused_frame_tree_node_id_ = FrameTreeNode::kFrameTreeNodeInvalidId; | |
| 273 | |
| 274 // TODO(avallee): https://crbug.com/610795 This line is not sufficient to | |
| 275 // make the test pass. There seems to be no focus change events generated. | |
| 276 root()->current_frame_host()->UpdateAXTreeData(); | |
| 277 return; | |
| 278 } | |
| 279 | 267 |
| 280 std::set<SiteInstance*> frame_tree_site_instances = | 268 std::set<SiteInstance*> frame_tree_site_instances = |
| 281 CollectSiteInstances(this); | 269 CollectSiteInstances(this); |
| 282 | 270 |
| 283 SiteInstance* current_instance = | 271 SiteInstance* current_instance = |
| 284 node->current_frame_host()->GetSiteInstance(); | 272 node->current_frame_host()->GetSiteInstance(); |
| 285 | 273 |
| 286 // Update the focused frame in all other SiteInstances. If focus changes to | 274 // Update the focused frame in all other SiteInstances. If focus changes to |
| 287 // a cross-process frame, this allows the old focused frame's renderer | 275 // a cross-process frame, this allows the old focused frame's renderer |
| 288 // process to clear focus from that frame and fire blur events. It also | 276 // process to clear focus from that frame and fire blur events. It also |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 // This is only used to set page-level focus in cross-process subframes, and | 460 // This is only used to set page-level focus in cross-process subframes, and |
| 473 // requests to set focus in main frame's SiteInstance are ignored. | 461 // requests to set focus in main frame's SiteInstance are ignored. |
| 474 if (instance != root_manager->current_frame_host()->GetSiteInstance()) { | 462 if (instance != root_manager->current_frame_host()->GetSiteInstance()) { |
| 475 RenderFrameProxyHost* proxy = | 463 RenderFrameProxyHost* proxy = |
| 476 root_manager->GetRenderFrameProxyHost(instance); | 464 root_manager->GetRenderFrameProxyHost(instance); |
| 477 proxy->Send(new InputMsg_SetFocus(proxy->GetRoutingID(), is_focused)); | 465 proxy->Send(new InputMsg_SetFocus(proxy->GetRoutingID(), is_focused)); |
| 478 } | 466 } |
| 479 } | 467 } |
| 480 | 468 |
| 481 } // namespace content | 469 } // namespace content |
| OLD | NEW |