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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 } | 320 } |
321 } | 321 } |
322 | 322 |
323 // If |node| was focused from a cross-process frame (i.e., via | 323 // If |node| was focused from a cross-process frame (i.e., via |
324 // window.focus()), tell its RenderFrame that it should focus. | 324 // window.focus()), tell its RenderFrame that it should focus. |
325 if (current_instance != source) | 325 if (current_instance != source) |
326 node->current_frame_host()->SetFocusedFrame(); | 326 node->current_frame_host()->SetFocusedFrame(); |
327 | 327 |
328 focused_frame_tree_node_id_ = node->frame_tree_node_id(); | 328 focused_frame_tree_node_id_ = node->frame_tree_node_id(); |
329 node->DidFocus(); | 329 node->DidFocus(); |
| 330 |
| 331 // The accessibility tree data for the root of the frame tree keeps |
| 332 // track of the focused frame too, so update that every time the |
| 333 // focused frame changes. |
| 334 root()->current_frame_host()->UpdateAXTreeData(); |
330 } | 335 } |
331 | 336 |
332 void FrameTree::SetFrameRemoveListener( | 337 void FrameTree::SetFrameRemoveListener( |
333 const base::Callback<void(RenderFrameHost*)>& on_frame_removed) { | 338 const base::Callback<void(RenderFrameHost*)>& on_frame_removed) { |
334 on_frame_removed_ = on_frame_removed; | 339 on_frame_removed_ = on_frame_removed; |
335 } | 340 } |
336 | 341 |
337 RenderViewHostImpl* FrameTree::CreateRenderViewHost( | 342 RenderViewHostImpl* FrameTree::CreateRenderViewHost( |
338 SiteInstance* site_instance, | 343 SiteInstance* site_instance, |
339 int32_t routing_id, | 344 int32_t routing_id, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 // This is only used to set page-level focus in cross-process subframes, and | 503 // This is only used to set page-level focus in cross-process subframes, and |
499 // requests to set focus in main frame's SiteInstance are ignored. | 504 // requests to set focus in main frame's SiteInstance are ignored. |
500 if (instance != root_manager->current_frame_host()->GetSiteInstance()) { | 505 if (instance != root_manager->current_frame_host()->GetSiteInstance()) { |
501 RenderFrameProxyHost* proxy = | 506 RenderFrameProxyHost* proxy = |
502 root_manager->GetRenderFrameProxyHost(instance); | 507 root_manager->GetRenderFrameProxyHost(instance); |
503 proxy->Send(new InputMsg_SetFocus(proxy->GetRoutingID(), is_focused)); | 508 proxy->Send(new InputMsg_SetFocus(proxy->GetRoutingID(), is_focused)); |
504 } | 509 } |
505 } | 510 } |
506 | 511 |
507 } // namespace content | 512 } // namespace content |
OLD | NEW |