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