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

Side by Side Diff: content/browser/frame_host/frame_tree.h

Issue 1104603002: Pick frame to navigate in the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test Created 5 years, 8 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 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_
6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 FrameTreeNode* root() const { return root_.get(); } 53 FrameTreeNode* root() const { return root_.get(); }
54 54
55 // Returns the FrameTreeNode with the given |frame_tree_node_id| if it is part 55 // Returns the FrameTreeNode with the given |frame_tree_node_id| if it is part
56 // of this FrameTree. 56 // of this FrameTree.
57 FrameTreeNode* FindByID(int64 frame_tree_node_id); 57 FrameTreeNode* FindByID(int64 frame_tree_node_id);
58 58
59 // Returns the FrameTreeNode with the given renderer-specific |routing_id|. 59 // Returns the FrameTreeNode with the given renderer-specific |routing_id|.
60 FrameTreeNode* FindByRoutingID(int process_id, int routing_id); 60 FrameTreeNode* FindByRoutingID(int process_id, int routing_id);
61 61
62 // Returns the first frame in this tree with the given |name|, or the main
63 // frame if |name| is empty.
64 // Note that this does NOT support pseudo-names like _self, _top, and _blank,
65 // nor searching other FrameTrees (unlike blink::WebView::findFrameByName).
66 FrameTreeNode* FindByName(const std::string& name);
67
62 // Executes |on_node| on each node in the frame tree. If |on_node| returns 68 // Executes |on_node| on each node in the frame tree. If |on_node| returns
63 // false, terminates the iteration immediately. Returning false is useful 69 // false, terminates the iteration immediately. Returning false is useful
64 // if |on_node| is just doing a search over the tree. The iteration proceeds 70 // if |on_node| is just doing a search over the tree. The iteration proceeds
65 // top-down and visits a node before adding its children to the queue, making 71 // top-down and visits a node before adding its children to the queue, making
66 // it safe to remove children during the callback. 72 // it safe to remove children during the callback.
67 void ForEach(const base::Callback<bool(FrameTreeNode*)>& on_node) const; 73 void ForEach(const base::Callback<bool(FrameTreeNode*)>& on_node) const;
68 74
69 // Frame tree manipulation routines. 75 // Frame tree manipulation routines.
70 // |process_id| is required to disambiguate |new_routing_id|, and it must 76 // |process_id| is required to disambiguate |new_routing_id|, and it must
71 // match the process of the |parent| node. Otherwise this method returns 77 // match the process of the |parent| node. Otherwise this method returns
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 189
184 // Overall load progress. 190 // Overall load progress.
185 double load_progress_; 191 double load_progress_;
186 192
187 DISALLOW_COPY_AND_ASSIGN(FrameTree); 193 DISALLOW_COPY_AND_ASSIGN(FrameTree);
188 }; 194 };
189 195
190 } // namespace content 196 } // namespace content
191 197
192 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_ 198 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698