blob: 7fbd42ddd613a7ebd4bc2d30af396fda336ec4a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/devtools/protocol/handler_helpers.h"
#include "content/browser/frame_host/frame_tree_node.h"
namespace content {
namespace protocol {
FrameTreeNode* FrameTreeNodeFromDevToolsFrameToken(
FrameTreeNode* root,
const std::string& devtools_frame_token) {
if (root->devtools_frame_token().ToString() == devtools_frame_token) {
return root;
} else {
for (FrameTreeNode* node : root->frame_tree()->SubtreeNodes(root)) {
if (node->devtools_frame_token().ToString() == devtools_frame_token) {
return node;
}
}
}
return nullptr;
}
} // namespace protocol
} // namespace content
|