OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/safe_browsing/incident_reporting/variations_seed_signat
ure_analyzer.h" |
| 6 |
| 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/metrics/variations/variations_service.h" |
| 9 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 10 #include "chrome/common/safe_browsing/csd.pb.h" |
| 11 |
| 12 namespace safe_browsing { |
| 13 |
| 14 void RegisterVariationsSeedSignatureAnalysis() { |
| 15 scoped_refptr<SafeBrowsingService> safe_browsing_service( |
| 16 g_browser_process->safe_browsing_service()); |
| 17 |
| 18 safe_browsing_service->RegisterDelayedAnalysisCallback( |
| 19 base::Bind(&VerifyVariationsSeedSignature)); |
| 20 } |
| 21 |
| 22 void VerifyVariationsSeedSignature(const AddIncidentCallback& callback) { |
| 23 std::string invalid_signature; |
| 24 if (g_browser_process->variations_service()->IsVariationsSeedSignatureInvalid( |
| 25 &invalid_signature)) { |
| 26 scoped_ptr<safe_browsing::ClientIncidentReport_IncidentData> incident_data( |
| 27 new safe_browsing::ClientIncidentReport_IncidentData()); |
| 28 safe_browsing:: |
| 29 ClientIncidentReport_IncidentData_VariationsSeedSignatureIncident* |
| 30 variations_seed_signature = |
| 31 incident_data->mutable_variations_seed_signature(); |
| 32 variations_seed_signature->set_variations_seed_signature(invalid_signature); |
| 33 callback.Run(incident_data.Pass()); |
| 34 } |
| 35 } |
| 36 |
| 37 } // namespace safe_browsing |
OLD | NEW |