| 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_node.h" | 5 #include "content/browser/frame_host/frame_tree_node.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // Loop over all children removing them from the FrameTree. This will ensure | 97 // Loop over all children removing them from the FrameTree. This will ensure |
| 98 // that nodes are properly removed from the tree and notifications are sent. | 98 // that nodes are properly removed from the tree and notifications are sent. |
| 99 // Note: since the |children_| vector is now empty, the calls into RemoveChild | 99 // Note: since the |children_| vector is now empty, the calls into RemoveChild |
| 100 // will be a noop and will not result in repeatedly traversing the list. | 100 // will be a noop and will not result in repeatedly traversing the list. |
| 101 for (const auto& child : old_children) | 101 for (const auto& child : old_children) |
| 102 frame_tree_->RemoveFrame(child); | 102 frame_tree_->RemoveFrame(child); |
| 103 | 103 |
| 104 old_children.clear(); // May notify observers. | 104 old_children.clear(); // May notify observers. |
| 105 } | 105 } |
| 106 | 106 |
| 107 void FrameTreeNode::SetFrameName(const std::string& name) { |
| 108 replication_state_.name = name; |
| 109 |
| 110 // Notify this frame's proxies about the updated name. |
| 111 render_manager_.OnDidUpdateName(name); |
| 112 } |
| 113 |
| 107 bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const { | 114 bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const { |
| 108 if (!other || !other->child_count()) | 115 if (!other || !other->child_count()) |
| 109 return false; | 116 return false; |
| 110 | 117 |
| 111 for (FrameTreeNode* node = parent(); node; node = node->parent()) { | 118 for (FrameTreeNode* node = parent(); node; node = node->parent()) { |
| 112 if (node == other) | 119 if (node == other) |
| 113 return true; | 120 return true; |
| 114 } | 121 } |
| 115 | 122 |
| 116 return false; | 123 return false; |
| 117 } | 124 } |
| 118 | 125 |
| 119 bool FrameTreeNode::CommitPendingSandboxFlags() { | 126 bool FrameTreeNode::CommitPendingSandboxFlags() { |
| 120 bool did_change_flags = | 127 bool did_change_flags = |
| 121 effective_sandbox_flags_ != replication_state_.sandbox_flags; | 128 effective_sandbox_flags_ != replication_state_.sandbox_flags; |
| 122 effective_sandbox_flags_ = replication_state_.sandbox_flags; | 129 effective_sandbox_flags_ = replication_state_.sandbox_flags; |
| 123 return did_change_flags; | 130 return did_change_flags; |
| 124 } | 131 } |
| 125 | 132 |
| 126 } // namespace content | 133 } // namespace content |
| OLD | NEW |