| 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/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "content/browser/frame_host/frame_tree.h" | 10 #include "content/browser/frame_host/frame_tree.h" |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 frame_tree_node->current_frame_host()->GetSiteInstance()); | 669 frame_tree_node->current_frame_host()->GetSiteInstance()); |
| 670 navigation_data_.reset(); | 670 navigation_data_.reset(); |
| 671 } | 671 } |
| 672 | 672 |
| 673 navigation_request->BeginNavigation(); | 673 navigation_request->BeginNavigation(); |
| 674 } | 674 } |
| 675 | 675 |
| 676 // PlzNavigate | 676 // PlzNavigate |
| 677 void NavigatorImpl::CommitNavigation(FrameTreeNode* frame_tree_node, | 677 void NavigatorImpl::CommitNavigation(FrameTreeNode* frame_tree_node, |
| 678 ResourceResponse* response, | 678 ResourceResponse* response, |
| 679 scoped_ptr<StreamHandle> body) { | 679 scoped_ptr<StreamHandle> body, |
| 680 int navigation_provider_id) { |
| 680 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 681 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 681 switches::kEnableBrowserSideNavigation)); | 682 switches::kEnableBrowserSideNavigation)); |
| 682 | 683 |
| 683 NavigationRequest* navigation_request = frame_tree_node->navigation_request(); | 684 NavigationRequest* navigation_request = frame_tree_node->navigation_request(); |
| 684 DCHECK(navigation_request); | 685 DCHECK(navigation_request); |
| 685 DCHECK(response || | 686 DCHECK(response || |
| 686 !ShouldMakeNetworkRequestForURL( | 687 !ShouldMakeNetworkRequestForURL( |
| 687 navigation_request->common_params().url)); | 688 navigation_request->common_params().url)); |
| 688 | 689 |
| 689 // HTTP 204 (No Content) and HTTP 205 (Reset Content) responses should not | 690 // HTTP 204 (No Content) and HTTP 205 (Reset Content) responses should not |
| (...skipping 17 matching lines...) Expand all Loading... |
| 707 frame_tree_node->render_manager()->current_frame_host()) { | 708 frame_tree_node->render_manager()->current_frame_host()) { |
| 708 DCHECK(!render_frame_host->GetParent()); | 709 DCHECK(!render_frame_host->GetParent()); |
| 709 render_frame_host->render_view_host()->Send( | 710 render_frame_host->render_view_host()->Send( |
| 710 new ViewMsg_EnableViewSourceMode( | 711 new ViewMsg_EnableViewSourceMode( |
| 711 render_frame_host->render_view_host()->GetRoutingID())); | 712 render_frame_host->render_view_host()->GetRoutingID())); |
| 712 } | 713 } |
| 713 | 714 |
| 714 CheckWebUIRendererDoesNotDisplayNormalURL( | 715 CheckWebUIRendererDoesNotDisplayNormalURL( |
| 715 render_frame_host, navigation_request->common_params().url); | 716 render_frame_host, navigation_request->common_params().url); |
| 716 | 717 |
| 717 render_frame_host->CommitNavigation(response, body.Pass(), | 718 render_frame_host->CommitNavigation( |
| 718 navigation_request->common_params(), | 719 response, body.Pass(), navigation_request->common_params(), |
| 719 navigation_request->request_params()); | 720 navigation_request->request_params(), navigation_provider_id); |
| 720 | |
| 721 } | 721 } |
| 722 | 722 |
| 723 // PlzNavigate | 723 // PlzNavigate |
| 724 void NavigatorImpl::FailedNavigation(FrameTreeNode* frame_tree_node, | 724 void NavigatorImpl::FailedNavigation(FrameTreeNode* frame_tree_node, |
| 725 bool has_stale_copy_in_cache, | 725 bool has_stale_copy_in_cache, |
| 726 int error_code) { | 726 int error_code) { |
| 727 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 727 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 728 switches::kEnableBrowserSideNavigation)); | 728 switches::kEnableBrowserSideNavigation)); |
| 729 | 729 |
| 730 NavigationRequest* navigation_request = frame_tree_node->navigation_request(); | 730 NavigationRequest* navigation_request = frame_tree_node->navigation_request(); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 entry->set_should_replace_entry(pending_entry->should_replace_entry()); | 917 entry->set_should_replace_entry(pending_entry->should_replace_entry()); |
| 918 entry->SetRedirectChain(pending_entry->GetRedirectChain()); | 918 entry->SetRedirectChain(pending_entry->GetRedirectChain()); |
| 919 } | 919 } |
| 920 controller_->SetPendingEntry(entry.Pass()); | 920 controller_->SetPendingEntry(entry.Pass()); |
| 921 if (delegate_) | 921 if (delegate_) |
| 922 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 922 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
| 923 } | 923 } |
| 924 } | 924 } |
| 925 | 925 |
| 926 } // namespace content | 926 } // namespace content |
| OLD | NEW |