Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: chrome/browser/safe_browsing/incident_reporting/omnibox_watcher.cc

Issue 856543004: Replace incident type handlers with implementations of Incident. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: robertshield comments Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/incident_reporting/omnibox_watcher.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/omnibox_watcher.cc b/chrome/browser/safe_browsing/incident_reporting/omnibox_watcher.cc
index 1509f35d19aaa94e8f8061f7d94449c45457c1d9..e0216ac6c99aeb83211527b45831d3688e98b05b 100644
--- a/chrome/browser/safe_browsing/incident_reporting/omnibox_watcher.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/omnibox_watcher.cc
@@ -8,6 +8,7 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/omnibox/omnibox_log.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/safe_browsing/incident_reporting/omnibox_interaction_incident.h"
#include "chrome/common/safe_browsing/csd.pb.h"
#include "components/omnibox/autocomplete_result.h"
#include "content/public/browser/notification_details.h"
@@ -42,12 +43,13 @@ void OmniboxWatcher::Observe(int type,
(log->elapsed_time_since_user_first_modified_omnibox <
base::TimeDelta::FromSeconds(1)) &&
!AutocompleteMatch::IsSearchType(selected_suggestion.type)) {
- scoped_ptr<ClientIncidentReport_IncidentData> incident_data(
- new ClientIncidentReport_IncidentData());
+ scoped_ptr<ClientIncidentReport_IncidentData_OmniboxInteractionIncident>
+ omnibox_interaction(
+ new ClientIncidentReport_IncidentData_OmniboxInteractionIncident());
const GURL& origin = selected_suggestion.destination_url.GetOrigin();
- incident_data->mutable_omnibox_interaction()->set_origin(
- origin.possibly_invalid_spec());
- incident_callback_.Run(incident_data.Pass());
+ omnibox_interaction->set_origin(origin.possibly_invalid_spec());
+ incident_callback_.Run(make_scoped_ptr(
+ new OmniboxInteractionIncident(omnibox_interaction.Pass())));
}
}

Powered by Google App Engine
This is Rietveld 408576698