| 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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "chrome/common/pepper_permission_util.h" | 30 #include "chrome/common/pepper_permission_util.h" |
| 31 #include "chrome/common/prerender_types.h" | 31 #include "chrome/common/prerender_types.h" |
| 32 #include "chrome/common/render_messages.h" | 32 #include "chrome/common/render_messages.h" |
| 33 #include "chrome/common/secure_origin_whitelist.h" | 33 #include "chrome/common/secure_origin_whitelist.h" |
| 34 #include "chrome/common/url_constants.h" | 34 #include "chrome/common/url_constants.h" |
| 35 #include "chrome/grit/chromium_strings.h" | 35 #include "chrome/grit/chromium_strings.h" |
| 36 #include "chrome/grit/generated_resources.h" | 36 #include "chrome/grit/generated_resources.h" |
| 37 #include "chrome/grit/locale_settings.h" | 37 #include "chrome/grit/locale_settings.h" |
| 38 #include "chrome/grit/renderer_resources.h" | 38 #include "chrome/grit/renderer_resources.h" |
| 39 #include "chrome/renderer/app_categorizer.h" | 39 #include "chrome/renderer/app_categorizer.h" |
| 40 #include "chrome/renderer/banners/app_banner_client.h" | |
| 41 #include "chrome/renderer/benchmarking_extension.h" | 40 #include "chrome/renderer/benchmarking_extension.h" |
| 42 #include "chrome/renderer/chrome_render_frame_observer.h" | 41 #include "chrome/renderer/chrome_render_frame_observer.h" |
| 43 #include "chrome/renderer/chrome_render_thread_observer.h" | 42 #include "chrome/renderer/chrome_render_thread_observer.h" |
| 44 #include "chrome/renderer/chrome_render_view_observer.h" | 43 #include "chrome/renderer/chrome_render_view_observer.h" |
| 45 #include "chrome/renderer/content_settings_observer.h" | 44 #include "chrome/renderer/content_settings_observer.h" |
| 46 #include "chrome/renderer/loadtimes_extension_bindings.h" | 45 #include "chrome/renderer/loadtimes_extension_bindings.h" |
| 47 #include "chrome/renderer/media/chrome_key_systems.h" | 46 #include "chrome/renderer/media/chrome_key_systems.h" |
| 48 #include "chrome/renderer/net/net_error_helper.h" | 47 #include "chrome/renderer/net/net_error_helper.h" |
| 49 #include "chrome/renderer/net_benchmarking_extension.h" | 48 #include "chrome/renderer/net_benchmarking_extension.h" |
| 50 #include "chrome/renderer/page_load_histograms.h" | 49 #include "chrome/renderer/page_load_histograms.h" |
| (...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 rappor_recorder_->RecordRappor(metric, sample); | 1341 rappor_recorder_->RecordRappor(metric, sample); |
| 1343 } | 1342 } |
| 1344 | 1343 |
| 1345 void ChromeContentRendererClient::RecordRapporURL(const std::string& metric, | 1344 void ChromeContentRendererClient::RecordRapporURL(const std::string& metric, |
| 1346 const GURL& url) { | 1345 const GURL& url) { |
| 1347 if (!rappor_recorder_) | 1346 if (!rappor_recorder_) |
| 1348 RenderThread::Get()->GetRemoteInterfaces()->GetInterface(&rappor_recorder_); | 1347 RenderThread::Get()->GetRemoteInterfaces()->GetInterface(&rappor_recorder_); |
| 1349 rappor_recorder_->RecordRapporURL(metric, url); | 1348 rappor_recorder_->RecordRapporURL(metric, url); |
| 1350 } | 1349 } |
| 1351 | 1350 |
| 1352 std::unique_ptr<blink::WebAppBannerClient> | |
| 1353 ChromeContentRendererClient::CreateAppBannerClient( | |
| 1354 content::RenderFrame* render_frame) { | |
| 1355 return std::unique_ptr<blink::WebAppBannerClient>( | |
| 1356 new AppBannerClient(render_frame)); | |
| 1357 } | |
| 1358 | |
| 1359 void ChromeContentRendererClient::AddImageContextMenuProperties( | 1351 void ChromeContentRendererClient::AddImageContextMenuProperties( |
| 1360 const WebURLResponse& response, | 1352 const WebURLResponse& response, |
| 1361 std::map<std::string, std::string>* properties) { | 1353 std::map<std::string, std::string>* properties) { |
| 1362 DCHECK(properties); | 1354 DCHECK(properties); |
| 1363 WebString header_key(ASCIIToUTF16( | 1355 WebString header_key(ASCIIToUTF16( |
| 1364 data_reduction_proxy::chrome_proxy_header())); | 1356 data_reduction_proxy::chrome_proxy_header())); |
| 1365 if (!response.httpHeaderField(header_key).isNull() && | 1357 if (!response.httpHeaderField(header_key).isNull() && |
| 1366 data_reduction_proxy::IsEmptyImagePreview( | 1358 data_reduction_proxy::IsEmptyImagePreview( |
| 1367 response.httpHeaderField(header_key).utf8())) { | 1359 response.httpHeaderField(header_key).utf8())) { |
| 1368 (*properties)[ | 1360 (*properties)[ |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1483 | 1475 |
| 1484 url::Replacements<char> r; | 1476 url::Replacements<char> r; |
| 1485 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1477 r.SetPath(path.c_str(), url::Component(0, path.length())); |
| 1486 | 1478 |
| 1487 if (result == internal::NUM_PLUGIN_ERROR) | 1479 if (result == internal::NUM_PLUGIN_ERROR) |
| 1488 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1480 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
| 1489 | 1481 |
| 1490 RecordYouTubeRewriteUMA(result); | 1482 RecordYouTubeRewriteUMA(result); |
| 1491 return corrected_url.ReplaceComponents(r); | 1483 return corrected_url.ReplaceComponents(r); |
| 1492 } | 1484 } |
| OLD | NEW |