summaryrefslogtreecommitdiffstats
path: root/content/browser/frame_host/frame_tree_node.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/frame_host/frame_tree_node.cc')
-rw-r--r--content/browser/frame_host/frame_tree_node.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc
index 3db5b6c..b87af21 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -162,6 +162,19 @@ bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const {
return false;
}
+FrameTreeNode* FrameTreeNode::PreviousSibling() const {
+ if (!parent_)
+ return nullptr;
+
+ for (size_t i = 0; i < parent_->child_count(); ++i) {
+ if (parent_->child_at(i) == this)
+ return (i == 0) ? nullptr : parent_->child_at(i - 1);
+ }
+
+ NOTREACHED() << "FrameTreeNode not found in its parent's children.";
+ return nullptr;
+}
+
bool FrameTreeNode::IsLoading() const {
RenderFrameHostImpl* current_frame_host =
render_manager_.current_frame_host();