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

Side by Side Diff: content/browser/frame_host/navigator_impl.cc

Issue 2966573003: Set UA override flag for Renderer-initiated NavigationRequest (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « content/browser/frame_host/navigation_request.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/browser/frame_host/navigator_impl.h" 5 #include "content/browser/frame_host/navigator_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 // main frame navigation that start via a BeginNavigation IPC, the 1012 // main frame navigation that start via a BeginNavigation IPC, the
1013 // RenderFrameHost will not be swapped. Therefore it is safe to call 1013 // RenderFrameHost will not be swapped. Therefore it is safe to call
1014 // DidStartMainFrameNavigation with the SiteInstance from the current 1014 // DidStartMainFrameNavigation with the SiteInstance from the current
1015 // RenderFrameHost. 1015 // RenderFrameHost.
1016 DidStartMainFrameNavigation( 1016 DidStartMainFrameNavigation(
1017 common_params.url, 1017 common_params.url,
1018 frame_tree_node->current_frame_host()->GetSiteInstance(), nullptr); 1018 frame_tree_node->current_frame_host()->GetSiteInstance(), nullptr);
1019 navigation_data_.reset(); 1019 navigation_data_.reset();
1020 } 1020 }
1021 NavigationEntryImpl* pending_entry = controller_->GetPendingEntry(); 1021 NavigationEntryImpl* pending_entry = controller_->GetPendingEntry();
1022 NavigationEntryImpl* current_entry = controller_->GetLastCommittedEntry();
1023 bool override_user_agent =
1024 current_entry ? current_entry->GetIsOverridingUserAgent() : false;
1022 frame_tree_node->CreatedNavigationRequest( 1025 frame_tree_node->CreatedNavigationRequest(
1023 NavigationRequest::CreateRendererInitiated( 1026 NavigationRequest::CreateRendererInitiated(
1024 frame_tree_node, pending_entry, common_params, begin_params, 1027 frame_tree_node, pending_entry, common_params, begin_params,
1025 controller_->GetLastCommittedEntryIndex(), 1028 controller_->GetLastCommittedEntryIndex(),
1026 controller_->GetEntryCount())); 1029 controller_->GetEntryCount(), override_user_agent));
1027 NavigationRequest* navigation_request = frame_tree_node->navigation_request(); 1030 NavigationRequest* navigation_request = frame_tree_node->navigation_request();
1028 1031
1029 // For main frames, NavigationHandle will be created after the call to 1032 // For main frames, NavigationHandle will be created after the call to
1030 // |DidStartMainFrameNavigation|, so it receives the most up to date pending 1033 // |DidStartMainFrameNavigation|, so it receives the most up to date pending
1031 // entry from the NavigationController. 1034 // entry from the NavigationController.
1032 navigation_request->BeginNavigation(); 1035 navigation_request->BeginNavigation();
1033 } 1036 }
1034 1037
1035 void NavigatorImpl::OnAbortNavigation(FrameTreeNode* frame_tree_node) { 1038 void NavigatorImpl::OnAbortNavigation(FrameTreeNode* frame_tree_node) {
1036 NavigationRequest* ongoing_navigation_request = 1039 NavigationRequest* ongoing_navigation_request =
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 if (navigation_handle) 1299 if (navigation_handle)
1297 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID()); 1300 navigation_handle->update_entry_id_for_transfer(entry->GetUniqueID());
1298 1301
1299 controller_->SetPendingEntry(std::move(entry)); 1302 controller_->SetPendingEntry(std::move(entry));
1300 if (delegate_) 1303 if (delegate_)
1301 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); 1304 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL);
1302 } 1305 }
1303 } 1306 }
1304 1307
1305 } // namespace content 1308 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_request.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698