| 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 deletable(false), | 14 deletable(false), |
| 15 inline_autocomplete_offset(string16::npos), | 15 inline_autocomplete_offset(string16::npos), |
| 16 transition(PageTransition::GENERATED), | 16 transition(content::PAGE_TRANSITION_GENERATED), |
| 17 is_history_what_you_typed_match(false), | 17 is_history_what_you_typed_match(false), |
| 18 type(SEARCH_WHAT_YOU_TYPED), | 18 type(SEARCH_WHAT_YOU_TYPED), |
| 19 template_url(NULL), | 19 template_url(NULL), |
| 20 starred(false), | 20 starred(false), |
| 21 from_previous(false) { | 21 from_previous(false) { |
| 22 } | 22 } |
| 23 | 23 |
| 24 AutocompleteMatch::AutocompleteMatch(AutocompleteProvider* provider, | 24 AutocompleteMatch::AutocompleteMatch(AutocompleteProvider* provider, |
| 25 int relevance, | 25 int relevance, |
| 26 bool deletable, | 26 bool deletable, |
| 27 Type type) | 27 Type type) |
| 28 : provider(provider), | 28 : provider(provider), |
| 29 relevance(relevance), | 29 relevance(relevance), |
| 30 deletable(deletable), | 30 deletable(deletable), |
| 31 inline_autocomplete_offset(string16::npos), | 31 inline_autocomplete_offset(string16::npos), |
| 32 transition(PageTransition::TYPED), | 32 transition(content::PAGE_TRANSITION_TYPED), |
| 33 is_history_what_you_typed_match(false), | 33 is_history_what_you_typed_match(false), |
| 34 type(type), | 34 type(type), |
| 35 template_url(NULL), | 35 template_url(NULL), |
| 36 starred(false), | 36 starred(false), |
| 37 from_previous(false) { | 37 from_previous(false) { |
| 38 } | 38 } |
| 39 | 39 |
| 40 AutocompleteMatch::~AutocompleteMatch() { | 40 AutocompleteMatch::~AutocompleteMatch() { |
| 41 } | 41 } |
| 42 | 42 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // The classifications should always be sorted. | 179 // The classifications should always be sorted. |
| 180 size_t last_offset = classifications[0].offset; | 180 size_t last_offset = classifications[0].offset; |
| 181 for (ACMatchClassifications::const_iterator i(classifications.begin() + 1); | 181 for (ACMatchClassifications::const_iterator i(classifications.begin() + 1); |
| 182 i != classifications.end(); ++i) { | 182 i != classifications.end(); ++i) { |
| 183 DCHECK(i->offset > last_offset) << "Classification unsorted"; | 183 DCHECK(i->offset > last_offset) << "Classification unsorted"; |
| 184 DCHECK(i->offset < text.length()) << "Classification out of bounds"; | 184 DCHECK(i->offset < text.length()) << "Classification out of bounds"; |
| 185 last_offset = i->offset; | 185 last_offset = i->offset; |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 #endif | 188 #endif |
| OLD | NEW |