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

Side by Side 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 unified diff | Download patch
OLDNEW
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // The RenderFrame no longer exists and will need to be created again. 91 // The RenderFrame no longer exists and will need to be created again.
92 current_frame_host()->SetRenderFrameCreated(false); 92 current_frame_host()->SetRenderFrameCreated(false);
93 93
94 // The children may not have been cleared if a cross-process navigation 94 // The children may not have been cleared if a cross-process navigation
95 // commits before the old process cleans everything up. Make sure the child 95 // commits before the old process cleans everything up. Make sure the child
96 // nodes get deleted before swapping to a new process. 96 // nodes get deleted before swapping to a new process.
97 ScopedVector<FrameTreeNode> old_children = children_.Pass(); 97 ScopedVector<FrameTreeNode> old_children = children_.Pass();
98 old_children.clear(); // May notify observers. 98 old_children.clear(); // May notify observers.
99 } 99 }
100 100
101 bool FrameTreeNode::IsDescendantOf(FrameTreeNode* other) const {
102 if (!other || !other->child_count())
103 return false;
104
105 for (FrameTreeNode* node = parent(); node; node = node->parent()) {
106 if (node == other)
107 return true;
108 }
109
110 return false;
111 }
112
101 } // namespace content 113 } // namespace content
OLDNEW
« 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