Index: chrome/browser/net/chrome_network_delegate.cc |
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc |
index 4de27d4fd55fa7fbde1af8979694dd0018b3389f..230b40b3fcfd613ffa05ba5603efa781be3e0df1 100644 |
--- a/chrome/browser/net/chrome_network_delegate.cc |
+++ b/chrome/browser/net/chrome_network_delegate.cc |
@@ -30,6 +30,7 @@ |
#include "chrome/browser/extensions/extension_system.h" |
#include "chrome/browser/google/google_util.h" |
#include "chrome/browser/net/chrome_network_data_saving_metrics.h" |
+#include "chrome/browser/net/client_hints.h" |
#include "chrome/browser/net/connect_interceptor.h" |
#include "chrome/browser/net/load_time_stats.h" |
#include "chrome/browser/performance_monitor/performance_monitor.h" |
@@ -334,6 +335,11 @@ void ChromeNetworkDelegate::set_predictor( |
new chrome_browser_net::ConnectInterceptor(predictor)); |
} |
+void ChromeNetworkDelegate::SetEnableClientHints() { |
+ client_hints_.reset(new ClientHints()); |
+ client_hints_->Init(); |
+} |
+ |
// static |
void ChromeNetworkDelegate::NeverThrottleRequests() { |
g_never_throttle_requests_ = true; |
@@ -418,6 +424,12 @@ int ChromeNetworkDelegate::OnBeforeURLRequest( |
if (enable_do_not_track_ && enable_do_not_track_->GetValue()) |
request->SetExtraRequestHeaderByName(kDNTHeader, "1", true /* override */); |
+ if (client_hints_) { |
+ request->SetExtraRequestHeaderByName( |
+ ClientHints::kDevicePixelRatioHeader, |
+ client_hints_->GetDevicePixelRatioHeader(), true); |
+ } |
+ |
bool force_safe_search = force_google_safe_search_ && |
force_google_safe_search_->GetValue(); |