Chromium Code Reviews| 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/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 return process_; | 311 return process_; |
| 312 } | 312 } |
| 313 | 313 |
| 314 RenderFrameHost* RenderFrameHostImpl::GetParent() { | 314 RenderFrameHost* RenderFrameHostImpl::GetParent() { |
| 315 FrameTreeNode* parent_node = frame_tree_node_->parent(); | 315 FrameTreeNode* parent_node = frame_tree_node_->parent(); |
| 316 if (!parent_node) | 316 if (!parent_node) |
| 317 return NULL; | 317 return NULL; |
| 318 return parent_node->current_frame_host(); | 318 return parent_node->current_frame_host(); |
| 319 } | 319 } |
| 320 | 320 |
| 321 void RenderFrameHostImpl::ForEachChildFrame( | |
| 322 const base::Callback<void(RenderFrameHost*)>& on_frame) { | |
| 323 if (this != frame_tree_node_->current_frame_host()) { | |
|
jam
2016/01/26 23:42:34
why is this needed?
robwu
2016/01/26 23:57:59
Just in case someone calls ForEachChildFrame on a
| |
| 324 NOTREACHED(); | |
| 325 return; | |
| 326 } | |
| 327 for (size_t i = 0; i < frame_tree_node_->child_count(); ++i) { | |
| 328 FrameTreeNode* child = frame_tree_node_->child_at(i); | |
| 329 on_frame.Run(child->current_frame_host()); | |
| 330 } | |
| 331 } | |
| 332 | |
| 321 int RenderFrameHostImpl::GetFrameTreeNodeId() { | 333 int RenderFrameHostImpl::GetFrameTreeNodeId() { |
| 322 return frame_tree_node_->frame_tree_node_id(); | 334 return frame_tree_node_->frame_tree_node_id(); |
| 323 } | 335 } |
| 324 | 336 |
| 325 const std::string& RenderFrameHostImpl::GetFrameName() { | 337 const std::string& RenderFrameHostImpl::GetFrameName() { |
| 326 return frame_tree_node_->frame_name(); | 338 return frame_tree_node_->frame_name(); |
| 327 } | 339 } |
| 328 | 340 |
| 329 bool RenderFrameHostImpl::IsCrossProcessSubframe() { | 341 bool RenderFrameHostImpl::IsCrossProcessSubframe() { |
| 330 FrameTreeNode* parent_node = frame_tree_node_->parent(); | 342 FrameTreeNode* parent_node = frame_tree_node_->parent(); |
| (...skipping 2221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2552 *dst = src; | 2564 *dst = src; |
| 2553 | 2565 |
| 2554 if (src.routing_id != -1) | 2566 if (src.routing_id != -1) |
| 2555 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); | 2567 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); |
| 2556 | 2568 |
| 2557 if (src.parent_routing_id != -1) | 2569 if (src.parent_routing_id != -1) |
| 2558 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); | 2570 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); |
| 2559 } | 2571 } |
| 2560 | 2572 |
| 2561 } // namespace content | 2573 } // namespace content |
| OLD | NEW |