Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Unified Diff: content/browser/frame_host/frame_tree_node.cc

Issue 860393004: Expose whether a frame is focused to the browser process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: kenrb review comment Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/frame_tree_node.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/frame_tree_node.cc
diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc
index d5f9279ea21dc4536e352e44f31bfc52e94859a9..6c75717bc558cb39bda8029a440baf0435fa63e5 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -98,4 +98,16 @@ void FrameTreeNode::ResetForNewProcess() {
old_children.clear(); // May notify observers.
}
+bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const {
+ if (!other || !other->child_count())
+ return false;
+
+ for (FrameTreeNode* node = parent(); node; node = node->parent()) {
+ if (node == other)
+ return true;
+ }
+
+ return false;
+}
+
} // namespace content
« no previous file with comments | « content/browser/frame_host/frame_tree_node.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698