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

Side by Side Diff: components/omnibox/browser/omnibox_metrics_provider.cc

Issue 2755503002: Add a new entry to omnibox_event.proto to log specific type of contextual suggestions (Closed)
Patch Set: specific_type_identifier can be used outside of contextual suggestions. Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 "components/omnibox/browser/omnibox_metrics_provider.h" 5 #include "components/omnibox/browser/omnibox_metrics_provider.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 // We consider a paste-and-search/paste-and-go action to have a closed popup 147 // We consider a paste-and-search/paste-and-go action to have a closed popup
148 // (as explained in omnibox_event.proto) even if it was not, because such 148 // (as explained in omnibox_event.proto) even if it was not, because such
149 // actions ignore the contents of the popup so it doesn't matter that it was 149 // actions ignore the contents of the popup so it doesn't matter that it was
150 // open. 150 // open.
151 omnibox_event->set_is_popup_open(log.is_popup_open && !log.is_paste_and_go); 151 omnibox_event->set_is_popup_open(log.is_popup_open && !log.is_paste_and_go);
152 omnibox_event->set_is_paste_and_go(log.is_paste_and_go); 152 omnibox_event->set_is_paste_and_go(log.is_paste_and_go);
153 153
154 for (AutocompleteResult::const_iterator i(log.result.begin()); 154 for (AutocompleteResult::const_iterator i(log.result.begin());
155 i != log.result.end(); ++i) { 155 i != log.result.end(); ++i) {
156 OmniboxEventProto::Suggestion* suggestion = omnibox_event->add_suggestion(); 156 OmniboxEventProto::Suggestion* suggestion = omnibox_event->add_suggestion();
157 suggestion->set_provider(i->provider->AsOmniboxEventProviderType()); 157 const auto provider_type = i->provider->AsOmniboxEventProviderType();
158 suggestion->set_provider(provider_type);
158 suggestion->set_result_type(AsOmniboxEventResultType(i->type)); 159 suggestion->set_result_type(AsOmniboxEventResultType(i->type));
159 suggestion->set_relevance(i->relevance); 160 suggestion->set_relevance(i->relevance);
160 if (i->typed_count != -1) 161 if (i->typed_count != -1)
161 suggestion->set_typed_count(i->typed_count); 162 suggestion->set_typed_count(i->typed_count);
163 suggestion->set_specific_type_identifier(i->specific_type_identifier);
Mark P 2017/03/21 19:54:25 Please only set the specific type field in the pro
gcomanici 2017/03/22 02:39:03 Done.
162 } 164 }
163 for (ProvidersInfo::const_iterator i(log.providers_info.begin()); 165 for (ProvidersInfo::const_iterator i(log.providers_info.begin());
164 i != log.providers_info.end(); ++i) { 166 i != log.providers_info.end(); ++i) {
165 OmniboxEventProto::ProviderInfo* provider_info = 167 OmniboxEventProto::ProviderInfo* provider_info =
166 omnibox_event->add_provider_info(); 168 omnibox_event->add_provider_info();
167 provider_info->CopyFrom(*i); 169 provider_info->CopyFrom(*i);
168 } 170 }
169 } 171 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698