OLD | NEW |
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/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 return false; | 152 return false; |
153 | 153 |
154 for (FrameTreeNode* node = parent(); node; node = node->parent()) { | 154 for (FrameTreeNode* node = parent(); node; node = node->parent()) { |
155 if (node == other) | 155 if (node == other) |
156 return true; | 156 return true; |
157 } | 157 } |
158 | 158 |
159 return false; | 159 return false; |
160 } | 160 } |
161 | 161 |
162 FrameTreeNode* FrameTreeNode::PreviousSibling() const { | |
163 if (!parent_) | |
164 return nullptr; | |
165 | |
166 for (size_t i = 0; i < parent_->child_count(); ++i) { | |
167 if (parent_->child_at(i) == this) | |
168 return (i == 0) ? nullptr : parent_->child_at(i - 1); | |
169 } | |
170 | |
171 NOTREACHED() << "FrameTreeNode not found in its parent's children."; | |
172 return nullptr; | |
173 } | |
174 | |
175 bool FrameTreeNode::IsLoading() const { | 162 bool FrameTreeNode::IsLoading() const { |
176 RenderFrameHostImpl* current_frame_host = | 163 RenderFrameHostImpl* current_frame_host = |
177 render_manager_.current_frame_host(); | 164 render_manager_.current_frame_host(); |
178 RenderFrameHostImpl* pending_frame_host = | 165 RenderFrameHostImpl* pending_frame_host = |
179 render_manager_.pending_frame_host(); | 166 render_manager_.pending_frame_host(); |
180 | 167 |
181 DCHECK(current_frame_host); | 168 DCHECK(current_frame_host); |
182 | 169 |
183 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 170 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
184 switches::kEnableBrowserSideNavigation)) { | 171 switches::kEnableBrowserSideNavigation)) { |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 283 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
297 "465796 FrameTreeNode::DidStopLoading::End")); | 284 "465796 FrameTreeNode::DidStopLoading::End")); |
298 } | 285 } |
299 | 286 |
300 void FrameTreeNode::DidChangeLoadProgress(double load_progress) { | 287 void FrameTreeNode::DidChangeLoadProgress(double load_progress) { |
301 loading_progress_ = load_progress; | 288 loading_progress_ = load_progress; |
302 frame_tree_->UpdateLoadProgress(); | 289 frame_tree_->UpdateLoadProgress(); |
303 } | 290 } |
304 | 291 |
305 } // namespace content | 292 } // namespace content |
OLD | NEW |