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_) { |
sky
2016/10/06 17:28:44
not {} here and 1340.
nigeltao1
2016/10/07 03:30:52
Done.
I'm a recovering Go programmer. :-)
| |
1333 RenderThread::Get()->GetRemoteInterfaces()->GetInterface(&rappor_recorder_); | |
1334 } | |
1335 rappor_recorder_->RecordRappor(metric, sample); | |
1333 } | 1336 } |
1334 | 1337 |
1335 void ChromeContentRendererClient::RecordRapporURL(const std::string& metric, | 1338 void ChromeContentRendererClient::RecordRapporURL(const std::string& metric, |
1336 const GURL& url) { | 1339 const GURL& url) { |
1337 RenderThread::Get()->Send(new ChromeViewHostMsg_RecordRapporURL(metric, url)); | 1340 if (!rappor_recorder_) { |
1341 RenderThread::Get()->GetRemoteInterfaces()->GetInterface(&rappor_recorder_); | |
1342 } | |
1343 rappor_recorder_->RecordRapporURL(metric, url); | |
1338 } | 1344 } |
1339 | 1345 |
1340 std::unique_ptr<blink::WebAppBannerClient> | 1346 std::unique_ptr<blink::WebAppBannerClient> |
1341 ChromeContentRendererClient::CreateAppBannerClient( | 1347 ChromeContentRendererClient::CreateAppBannerClient( |
1342 content::RenderFrame* render_frame) { | 1348 content::RenderFrame* render_frame) { |
1343 return std::unique_ptr<blink::WebAppBannerClient>( | 1349 return std::unique_ptr<blink::WebAppBannerClient>( |
1344 new AppBannerClient(render_frame)); | 1350 new AppBannerClient(render_frame)); |
1345 } | 1351 } |
1346 | 1352 |
1347 void ChromeContentRendererClient::AddImageContextMenuProperties( | 1353 void ChromeContentRendererClient::AddImageContextMenuProperties( |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1471 | 1477 |
1472 url::Replacements<char> r; | 1478 url::Replacements<char> r; |
1473 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1479 r.SetPath(path.c_str(), url::Component(0, path.length())); |
1474 | 1480 |
1475 if (result == internal::NUM_PLUGIN_ERROR) | 1481 if (result == internal::NUM_PLUGIN_ERROR) |
1476 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1482 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
1477 | 1483 |
1478 RecordYouTubeRewriteUMA(result); | 1484 RecordYouTubeRewriteUMA(result); |
1479 return corrected_url.ReplaceComponents(r); | 1485 return corrected_url.ReplaceComponents(r); |
1480 } | 1486 } |
OLD | NEW |