| 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 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1329 #if defined(ENABLE_EXTENSIONS) | 1329 #if defined(ENABLE_EXTENSIONS) |
| 1330 return ChromeExtensionsRendererClient::CreateBrowserPluginDelegate( | 1330 return ChromeExtensionsRendererClient::CreateBrowserPluginDelegate( |
| 1331 render_frame, mime_type, original_url); | 1331 render_frame, mime_type, original_url); |
| 1332 #else | 1332 #else |
| 1333 return nullptr; | 1333 return nullptr; |
| 1334 #endif | 1334 #endif |
| 1335 } | 1335 } |
| 1336 | 1336 |
| 1337 void ChromeContentRendererClient::RecordRappor(const std::string& metric, | 1337 void ChromeContentRendererClient::RecordRappor(const std::string& metric, |
| 1338 const std::string& sample) { | 1338 const std::string& sample) { |
| 1339 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRappor(metric, sample)); | 1339 if (!rappor_recorder_) |
| 1340 RenderThread::Get()->GetRemoteInterfaces()->GetInterface(&rappor_recorder_); |
| 1341 rappor_recorder_->RecordRappor(metric, sample); |
| 1340 } | 1342 } |
| 1341 | 1343 |
| 1342 void ChromeContentRendererClient::RecordRapporURL(const std::string& metric, | 1344 void ChromeContentRendererClient::RecordRapporURL(const std::string& metric, |
| 1343 const GURL& url) { | 1345 const GURL& url) { |
| 1344 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRapporURL(metric, url)); | 1346 if (!rappor_recorder_) |
| 1347 RenderThread::Get()->GetRemoteInterfaces()->GetInterface(&rappor_recorder_); |
| 1348 rappor_recorder_->RecordRapporURL(metric, url); |
| 1345 } | 1349 } |
| 1346 | 1350 |
| 1347 std::unique_ptr<blink::WebAppBannerClient> | 1351 std::unique_ptr<blink::WebAppBannerClient> |
| 1348 ChromeContentRendererClient::CreateAppBannerClient( | 1352 ChromeContentRendererClient::CreateAppBannerClient( |
| 1349 content::RenderFrame* render_frame) { | 1353 content::RenderFrame* render_frame) { |
| 1350 return std::unique_ptr<blink::WebAppBannerClient>( | 1354 return std::unique_ptr<blink::WebAppBannerClient>( |
| 1351 new AppBannerClient(render_frame)); | 1355 new AppBannerClient(render_frame)); |
| 1352 } | 1356 } |
| 1353 | 1357 |
| 1354 void ChromeContentRendererClient::AddImageContextMenuProperties( | 1358 void ChromeContentRendererClient::AddImageContextMenuProperties( |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1478 | 1482 |
| 1479 url::Replacements<char> r; | 1483 url::Replacements<char> r; |
| 1480 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1484 r.SetPath(path.c_str(), url::Component(0, path.length())); |
| 1481 | 1485 |
| 1482 if (result == internal::NUM_PLUGIN_ERROR) | 1486 if (result == internal::NUM_PLUGIN_ERROR) |
| 1483 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1487 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
| 1484 | 1488 |
| 1485 RecordYouTubeRewriteUMA(result); | 1489 RecordYouTubeRewriteUMA(result); |
| 1486 return corrected_url.ReplaceComponents(r); | 1490 return corrected_url.ReplaceComponents(r); |
| 1487 } | 1491 } |
| OLD | NEW |