OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/logging.h" | 5 #include "base/logging.h" |
6 #include "chrome/browser/autocomplete/autocomplete_match.h" | 6 #include "chrome/browser/autocomplete/autocomplete_match.h" |
7 #include "grit/theme_resources.h" | 7 #include "grit/theme_resources.h" |
8 | 8 |
9 // AutocompleteMatch ---------------------------------------------------------- | 9 // AutocompleteMatch ---------------------------------------------------------- |
10 | 10 |
11 AutocompleteMatch::AutocompleteMatch() | 11 AutocompleteMatch::AutocompleteMatch() |
12 : provider(NULL), | 12 : provider(NULL), |
13 relevance(0), | 13 relevance(0), |
| 14 confidence(0.0f), |
14 deletable(false), | 15 deletable(false), |
15 inline_autocomplete_offset(string16::npos), | 16 inline_autocomplete_offset(string16::npos), |
16 transition(PageTransition::GENERATED), | 17 transition(PageTransition::GENERATED), |
17 is_history_what_you_typed_match(false), | 18 is_history_what_you_typed_match(false), |
18 type(SEARCH_WHAT_YOU_TYPED), | 19 type(SEARCH_WHAT_YOU_TYPED), |
19 template_url(NULL), | 20 template_url(NULL), |
20 starred(false), | 21 starred(false), |
21 from_previous(false) { | 22 from_previous(false) { |
22 } | 23 } |
23 | 24 |
24 AutocompleteMatch::AutocompleteMatch(AutocompleteProvider* provider, | 25 AutocompleteMatch::AutocompleteMatch(AutocompleteProvider* provider, |
25 int relevance, | 26 int relevance, |
| 27 float confidence, |
26 bool deletable, | 28 bool deletable, |
27 Type type) | 29 Type type) |
28 : provider(provider), | 30 : provider(provider), |
29 relevance(relevance), | 31 relevance(relevance), |
| 32 confidence(confidence), |
30 deletable(deletable), | 33 deletable(deletable), |
31 inline_autocomplete_offset(string16::npos), | 34 inline_autocomplete_offset(string16::npos), |
32 transition(PageTransition::TYPED), | 35 transition(PageTransition::TYPED), |
33 is_history_what_you_typed_match(false), | 36 is_history_what_you_typed_match(false), |
34 type(type), | 37 type(type), |
35 template_url(NULL), | 38 template_url(NULL), |
36 starred(false), | 39 starred(false), |
37 from_previous(false) { | 40 from_previous(false) { |
38 } | 41 } |
39 | 42 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 // The classifications should always be sorted. | 182 // The classifications should always be sorted. |
180 size_t last_offset = classifications[0].offset; | 183 size_t last_offset = classifications[0].offset; |
181 for (ACMatchClassifications::const_iterator i(classifications.begin() + 1); | 184 for (ACMatchClassifications::const_iterator i(classifications.begin() + 1); |
182 i != classifications.end(); ++i) { | 185 i != classifications.end(); ++i) { |
183 DCHECK(i->offset > last_offset) << "Classification unsorted"; | 186 DCHECK(i->offset > last_offset) << "Classification unsorted"; |
184 DCHECK(i->offset < text.length()) << "Classification out of bounds"; | 187 DCHECK(i->offset < text.length()) << "Classification out of bounds"; |
185 last_offset = i->offset; | 188 last_offset = i->offset; |
186 } | 189 } |
187 } | 190 } |
188 #endif | 191 #endif |
OLD | NEW |