OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1393 RenderThread::Get()->GetConnector()->BindInterface( | 1393 RenderThread::Get()->GetConnector()->BindInterface( |
1394 content::mojom::kBrowserServiceName, &rappor_recorder_); | 1394 content::mojom::kBrowserServiceName, &rappor_recorder_); |
1395 } | 1395 } |
1396 rappor_recorder_->RecordRapporURL(metric, url); | 1396 rappor_recorder_->RecordRapporURL(metric, url); |
1397 } | 1397 } |
1398 | 1398 |
1399 void ChromeContentRendererClient::AddImageContextMenuProperties( | 1399 void ChromeContentRendererClient::AddImageContextMenuProperties( |
1400 const WebURLResponse& response, | 1400 const WebURLResponse& response, |
1401 std::map<std::string, std::string>* properties) { | 1401 std::map<std::string, std::string>* properties) { |
1402 DCHECK(properties); | 1402 DCHECK(properties); |
1403 WebString header_key(WebString::FromASCII( | 1403 |
| 1404 WebString cpct_value = response.HttpHeaderField(WebString::FromASCII( |
1404 data_reduction_proxy::chrome_proxy_content_transform_header())); | 1405 data_reduction_proxy::chrome_proxy_content_transform_header())); |
1405 if (!response.HttpHeaderField(header_key).IsNull() && | 1406 WebString chrome_proxy_value = response.HttpHeaderField( |
1406 data_reduction_proxy::IsEmptyImagePreview( | 1407 WebString::FromASCII(data_reduction_proxy::chrome_proxy_header())); |
1407 response.HttpHeaderField(header_key).Utf8())) { | 1408 |
1408 (*properties)[ | 1409 if (data_reduction_proxy::IsEmptyImagePreview(cpct_value.Utf8(), |
1409 data_reduction_proxy::chrome_proxy_content_transform_header()] = | 1410 chrome_proxy_value.Utf8())) { |
| 1411 (*properties) |
| 1412 [data_reduction_proxy::chrome_proxy_content_transform_header()] = |
1410 data_reduction_proxy::empty_image_directive(); | 1413 data_reduction_proxy::empty_image_directive(); |
1411 } | 1414 } |
1412 } | 1415 } |
1413 | 1416 |
1414 void ChromeContentRendererClient::RunScriptsAtDocumentStart( | 1417 void ChromeContentRendererClient::RunScriptsAtDocumentStart( |
1415 content::RenderFrame* render_frame) { | 1418 content::RenderFrame* render_frame) { |
1416 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1419 #if BUILDFLAG(ENABLE_EXTENSIONS) |
1417 ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentStart( | 1420 ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentStart( |
1418 render_frame); | 1421 render_frame); |
1419 // |render_frame| might be dead by now. | 1422 // |render_frame| might be dead by now. |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 | 1538 |
1536 RecordYouTubeRewriteUMA(result); | 1539 RecordYouTubeRewriteUMA(result); |
1537 return corrected_url.ReplaceComponents(r); | 1540 return corrected_url.ReplaceComponents(r); |
1538 } | 1541 } |
1539 | 1542 |
1540 std::unique_ptr<base::TaskScheduler::InitParams> | 1543 std::unique_ptr<base::TaskScheduler::InitParams> |
1541 ChromeContentRendererClient::GetTaskSchedulerInitParams() { | 1544 ChromeContentRendererClient::GetTaskSchedulerInitParams() { |
1542 return task_scheduler_util:: | 1545 return task_scheduler_util:: |
1543 GetRendererTaskSchedulerInitParamsFromCommandLine(); | 1546 GetRendererTaskSchedulerInitParamsFromCommandLine(); |
1544 } | 1547 } |
OLD | NEW |