| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2015 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/omnibox_interaction_in
cident.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "chrome/common/safe_browsing/csd.pb.h" |
| 9 |
| 10 namespace safe_browsing { |
| 11 |
| 12 OmniboxInteractionIncident::OmniboxInteractionIncident( |
| 13 scoped_ptr<ClientIncidentReport_IncidentData_OmniboxInteractionIncident> |
| 14 omnibox_interaction_incident) { |
| 15 DCHECK(omnibox_interaction_incident); |
| 16 DCHECK(omnibox_interaction_incident->has_origin()); |
| 17 payload()->set_allocated_omnibox_interaction( |
| 18 omnibox_interaction_incident.release()); |
| 19 } |
| 20 |
| 21 OmniboxInteractionIncident::~OmniboxInteractionIncident() { |
| 22 } |
| 23 |
| 24 IncidentType OmniboxInteractionIncident::GetType() const { |
| 25 return IncidentType::OMNIBOX_INTERACTION; |
| 26 } |
| 27 |
| 28 std::string OmniboxInteractionIncident::GetKey() const { |
| 29 // Return a constant, as only one kind of suspicious interaction is detected. |
| 30 return "1"; |
| 31 } |
| 32 |
| 33 uint32_t OmniboxInteractionIncident::ComputeDigest() const { |
| 34 // Return a constant (independent of the incident's payload) so that only the |
| 35 // first suspicious interaction is reported. |
| 36 return 1u; |
| 37 } |
| 38 |
| 39 } // namespace safe_browsing |
| OLD | NEW |