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