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

Side by Side Diff: chrome/browser/metrics/omnibox_metrics_provider.cc

Issue 1154063003: removing ShouldHideTopMatch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed deprecated var name Created 5 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/metrics/omnibox_metrics_provider.h" 5 #include "chrome/browser/metrics/omnibox_metrics_provider.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 omnibox_event->set_duration_since_last_default_match_update_ms( 137 omnibox_event->set_duration_since_last_default_match_update_ms(
138 log.elapsed_time_since_last_change_to_default_match.InMilliseconds()); 138 log.elapsed_time_since_last_change_to_default_match.InMilliseconds());
139 } 139 }
140 omnibox_event->set_current_page_classification( 140 omnibox_event->set_current_page_classification(
141 log.current_page_classification); 141 log.current_page_classification);
142 omnibox_event->set_input_type(log.input_type); 142 omnibox_event->set_input_type(log.input_type);
143 // We consider a paste-and-search/paste-and-go action to have a closed popup 143 // We consider a paste-and-search/paste-and-go action to have a closed popup
144 // (as explained in omnibox_event.proto) even if it was not, because such 144 // (as explained in omnibox_event.proto) even if it was not, because such
145 // actions ignore the contents of the popup so it doesn't matter that it was 145 // actions ignore the contents of the popup so it doesn't matter that it was
146 // open. 146 // open.
147 const bool consider_popup_open = log.is_popup_open && !log.is_paste_and_go; 147 omnibox_event->set_is_popup_open(log.is_popup_open && !log.is_paste_and_go);
148 omnibox_event->set_is_popup_open(consider_popup_open);
149 omnibox_event->set_is_paste_and_go(log.is_paste_and_go); 148 omnibox_event->set_is_paste_and_go(log.is_paste_and_go);
150 if (consider_popup_open) {
151 omnibox_event->set_is_top_result_hidden_in_dropdown(
152 log.result.ShouldHideTopMatch());
153 }
154 149
155 for (AutocompleteResult::const_iterator i(log.result.begin()); 150 for (AutocompleteResult::const_iterator i(log.result.begin());
156 i != log.result.end(); ++i) { 151 i != log.result.end(); ++i) {
157 OmniboxEventProto::Suggestion* suggestion = omnibox_event->add_suggestion(); 152 OmniboxEventProto::Suggestion* suggestion = omnibox_event->add_suggestion();
158 suggestion->set_provider(i->provider->AsOmniboxEventProviderType()); 153 suggestion->set_provider(i->provider->AsOmniboxEventProviderType());
159 suggestion->set_result_type(AsOmniboxEventResultType(i->type)); 154 suggestion->set_result_type(AsOmniboxEventResultType(i->type));
160 suggestion->set_relevance(i->relevance); 155 suggestion->set_relevance(i->relevance);
161 if (i->typed_count != -1) 156 if (i->typed_count != -1)
162 suggestion->set_typed_count(i->typed_count); 157 suggestion->set_typed_count(i->typed_count);
163 } 158 }
164 for (ProvidersInfo::const_iterator i(log.providers_info.begin()); 159 for (ProvidersInfo::const_iterator i(log.providers_info.begin());
165 i != log.providers_info.end(); ++i) { 160 i != log.providers_info.end(); ++i) {
166 OmniboxEventProto::ProviderInfo* provider_info = 161 OmniboxEventProto::ProviderInfo* provider_info =
167 omnibox_event->add_provider_info(); 162 omnibox_event->add_provider_info();
168 provider_info->CopyFrom(*i); 163 provider_info->CopyFrom(*i);
169 } 164 }
170 } 165 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698