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

Unified Diff: content/browser/frame_host/navigation_request.cc

Issue 2777813003: Fix mobile user agent string not being used when PlzNavigate is enabled. (Closed)
Patch Set: review comment Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_request.cc
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index c4a3e3a4a1c00726890ed2c3700f882acd467621..c4ce4b8242ceb50f2b3ec01ac65ab6402ae4a4fc 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -341,8 +341,12 @@ NavigationRequest::NavigationRequest(
common_params_.method == "POST");
// Add necessary headers that may not be present in the BeginNavigationParams.
- const std::string user_agent_override =
- frame_tree_node_->navigator()->GetDelegate()->GetUserAgentOverride();
+ std::string user_agent_override;
+ if (entry && entry->GetIsOverridingUserAgent()) {
+ user_agent_override =
+ frame_tree_node_->navigator()->GetDelegate()->GetUserAgentOverride();
+ }
+
net::HttpRequestHeaders headers;
headers.AddHeadersFromString(begin_params_.headers);
AddAdditionalRequestHeaders(
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698