OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/autocomplete/contact_provider_chromeos.h" | 5 #include "chrome/browser/autocomplete/contact_provider_chromeos.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/i18n/break_iterator.h" | 10 #include "base/i18n/break_iterator.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 } | 220 } |
221 | 221 |
222 matches_.push_back(CreateAutocompleteMatch(input, contact)); | 222 matches_.push_back(CreateAutocompleteMatch(input, contact)); |
223 matches_.back().contents_class = classifications; | 223 matches_.back().contents_class = classifications; |
224 } | 224 } |
225 | 225 |
226 AutocompleteMatch ContactProvider::CreateAutocompleteMatch( | 226 AutocompleteMatch ContactProvider::CreateAutocompleteMatch( |
227 const AutocompleteInput& input, | 227 const AutocompleteInput& input, |
228 const ContactData& contact) { | 228 const ContactData& contact) { |
229 AutocompleteMatch match(this, 0, false, AutocompleteMatchType::CONTACT); | 229 AutocompleteMatch match(this, 0, false, AutocompleteMatchType::CONTACT); |
230 match.inline_autocomplete_offset = string16::npos; | |
231 match.contents = contact.full_name; | 230 match.contents = contact.full_name; |
232 match.fill_into_edit = match.contents; | 231 match.fill_into_edit = match.contents; |
233 match.relevance = kBaseRelevance + | 232 match.relevance = kBaseRelevance + |
234 static_cast<int>(roundf(kAffinityRelevanceBoost * contact.affinity)); | 233 static_cast<int>(roundf(kAffinityRelevanceBoost * contact.affinity)); |
235 match.RecordAdditionalInfo(kMatchContactIdKey, contact.contact_id); | 234 match.RecordAdditionalInfo(kMatchContactIdKey, contact.contact_id); |
236 return match; | 235 return match; |
237 } | 236 } |
OLD | NEW |