| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 // TODO(fdegans): Check if this is a same-document navigation and set the | 306 // TODO(fdegans): Check if this is a same-document navigation and set the |
| 307 // proper argument. | 307 // proper argument. |
| 308 DidStartLoading(true, was_previously_loading); | 308 DidStartLoading(true, was_previously_loading); |
| 309 } | 309 } |
| 310 } | 310 } |
| 311 | 311 |
| 312 void FrameTreeNode::ResetNavigationRequest(bool keep_state) { | 312 void FrameTreeNode::ResetNavigationRequest(bool keep_state) { |
| 313 CHECK(IsBrowserSideNavigationEnabled()); | 313 CHECK(IsBrowserSideNavigationEnabled()); |
| 314 if (!navigation_request_) | 314 if (!navigation_request_) |
| 315 return; | 315 return; |
| 316 bool was_renderer_initiated = !navigation_request_->browser_initiated(); |
| 316 navigation_request_.reset(); | 317 navigation_request_.reset(); |
| 317 | 318 |
| 318 if (keep_state) | 319 if (keep_state) |
| 319 return; | 320 return; |
| 320 | 321 |
| 321 // The RenderFrameHostManager should clean up any speculative RenderFrameHost | 322 // The RenderFrameHostManager should clean up any speculative RenderFrameHost |
| 322 // it created for the navigation. Also register that the load stopped. | 323 // it created for the navigation. Also register that the load stopped. |
| 323 DidStopLoading(); | 324 DidStopLoading(); |
| 324 render_manager_.CleanUpNavigation(); | 325 render_manager_.CleanUpNavigation(); |
| 326 |
| 327 // If the navigation is renderer-initiated, the renderer should also be |
| 328 // informed that the navigation stopped. |
| 329 if (was_renderer_initiated) { |
| 330 current_frame_host()->Send( |
| 331 new FrameMsg_Stop(current_frame_host()->GetRoutingID())); |
| 332 } |
| 333 |
| 325 } | 334 } |
| 326 | 335 |
| 327 bool FrameTreeNode::has_started_loading() const { | 336 bool FrameTreeNode::has_started_loading() const { |
| 328 return loading_progress_ != kLoadingProgressNotStarted; | 337 return loading_progress_ != kLoadingProgressNotStarted; |
| 329 } | 338 } |
| 330 | 339 |
| 331 void FrameTreeNode::reset_loading_progress() { | 340 void FrameTreeNode::reset_loading_progress() { |
| 332 loading_progress_ = kLoadingProgressNotStarted; | 341 loading_progress_ = kLoadingProgressNotStarted; |
| 333 } | 342 } |
| 334 | 343 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 speculative_frame_host->ResetLoadingState(); | 434 speculative_frame_host->ResetLoadingState(); |
| 426 } else { | 435 } else { |
| 427 RenderFrameHostImpl* pending_frame_host = | 436 RenderFrameHostImpl* pending_frame_host = |
| 428 render_manager_.pending_frame_host(); | 437 render_manager_.pending_frame_host(); |
| 429 if (pending_frame_host) | 438 if (pending_frame_host) |
| 430 pending_frame_host->ResetLoadingState(); | 439 pending_frame_host->ResetLoadingState(); |
| 431 } | 440 } |
| 432 } | 441 } |
| 433 | 442 |
| 434 } // namespace content | 443 } // namespace content |
| OLD | NEW |