Chromium Code Reviews| Index: chrome/browser/safe_browsing/incident_reporting/omnibox_incident_handlers.cc |
| diff --git a/chrome/browser/safe_browsing/incident_reporting/omnibox_incident_handlers.cc b/chrome/browser/safe_browsing/incident_reporting/omnibox_incident_handlers.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e13c955169624a91cc2c06b97112bf50b3c698ef |
| --- /dev/null |
| +++ b/chrome/browser/safe_browsing/incident_reporting/omnibox_incident_handlers.cc |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/safe_browsing/incident_reporting/omnibox_incident_handlers.h" |
| + |
| +#include "base/logging.h" |
| +#include "chrome/browser/safe_browsing/incident_reporting/incident_handler_util.h" |
|
grt (UTC plus 2)
2014/12/05 18:40:56
unused
Mark P
2014/12/09 19:23:30
Done.
|
| +#include "chrome/common/safe_browsing/csd.pb.h" |
| + |
| +namespace safe_browsing { |
| + |
| +std::string GetOmniboxIncidentKey( |
| + const ClientIncidentReport_IncidentData& incident_data) { |
| + DCHECK(incident_data.has_omnibox_interaction()); |
| + // We want to only return the first suspicious omnibox interaction so we use |
|
grt (UTC plus 2)
2014/12/05 18:40:56
There's been some discussion on chromium-dev about
Mark P
2014/12/09 19:23:30
Thanks for the improved comment. The original com
|
| + // a constant key so all later reports will be duped against this one. |
| + return std::string("1"); |
| +} |
| + |
| +uint32_t GetOmniboxIncidentDigest( |
| + const ClientIncidentReport_IncidentData& incident_data) { |
| + DCHECK(incident_data.has_omnibox_interaction()); |
| + // We use a constant digest because don't need to report additional |
|
grt (UTC plus 2)
2014/12/05 18:40:56
// Return a constant (independent of the incident'
Mark P
2014/12/09 19:23:29
Done.
|
| + // information. |
| + return 1u; |
| +} |
| + |
| +} // namespace safe_browsing |