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/autocomplete_match.h" | 5 #include "chrome/browser/autocomplete/autocomplete_match.h" |
6 | 6 |
7 #include "base/i18n/time_formatting.h" | 7 #include "base/i18n/time_formatting.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 0x2029, // Paragraph separator | 37 0x2029, // Paragraph separator |
38 0 | 38 0 |
39 }; | 39 }; |
40 | 40 |
41 AutocompleteMatch::AutocompleteMatch() | 41 AutocompleteMatch::AutocompleteMatch() |
42 : provider(NULL), | 42 : provider(NULL), |
43 relevance(0), | 43 relevance(0), |
44 typed_count(-1), | 44 typed_count(-1), |
45 deletable(false), | 45 deletable(false), |
46 inline_autocomplete_offset(string16::npos), | 46 inline_autocomplete_offset(string16::npos), |
| 47 allowed_to_be_default_match(false), |
47 transition(content::PAGE_TRANSITION_GENERATED), | 48 transition(content::PAGE_TRANSITION_GENERATED), |
48 is_history_what_you_typed_match(false), | 49 is_history_what_you_typed_match(false), |
49 type(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED), | 50 type(AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED), |
50 starred(false), | 51 starred(false), |
51 from_previous(false) { | 52 from_previous(false) { |
52 } | 53 } |
53 | 54 |
54 AutocompleteMatch::AutocompleteMatch(AutocompleteProvider* provider, | 55 AutocompleteMatch::AutocompleteMatch(AutocompleteProvider* provider, |
55 int relevance, | 56 int relevance, |
56 bool deletable, | 57 bool deletable, |
57 Type type) | 58 Type type) |
58 : provider(provider), | 59 : provider(provider), |
59 relevance(relevance), | 60 relevance(relevance), |
60 typed_count(-1), | 61 typed_count(-1), |
61 deletable(deletable), | 62 deletable(deletable), |
62 inline_autocomplete_offset(string16::npos), | 63 inline_autocomplete_offset(string16::npos), |
| 64 allowed_to_be_default_match(false), |
63 transition(content::PAGE_TRANSITION_TYPED), | 65 transition(content::PAGE_TRANSITION_TYPED), |
64 is_history_what_you_typed_match(false), | 66 is_history_what_you_typed_match(false), |
65 type(type), | 67 type(type), |
66 starred(false), | 68 starred(false), |
67 from_previous(false) { | 69 from_previous(false) { |
68 } | 70 } |
69 | 71 |
70 AutocompleteMatch::AutocompleteMatch(const AutocompleteMatch& match) | 72 AutocompleteMatch::AutocompleteMatch(const AutocompleteMatch& match) |
71 : provider(match.provider), | 73 : provider(match.provider), |
72 relevance(match.relevance), | 74 relevance(match.relevance), |
73 typed_count(match.typed_count), | 75 typed_count(match.typed_count), |
74 deletable(match.deletable), | 76 deletable(match.deletable), |
75 fill_into_edit(match.fill_into_edit), | 77 fill_into_edit(match.fill_into_edit), |
76 inline_autocomplete_offset(match.inline_autocomplete_offset), | 78 inline_autocomplete_offset(match.inline_autocomplete_offset), |
| 79 allowed_to_be_default_match(match.allowed_to_be_default_match), |
77 destination_url(match.destination_url), | 80 destination_url(match.destination_url), |
78 stripped_destination_url(match.stripped_destination_url), | 81 stripped_destination_url(match.stripped_destination_url), |
79 contents(match.contents), | 82 contents(match.contents), |
80 contents_class(match.contents_class), | 83 contents_class(match.contents_class), |
81 description(match.description), | 84 description(match.description), |
82 description_class(match.description_class), | 85 description_class(match.description_class), |
83 transition(match.transition), | 86 transition(match.transition), |
84 is_history_what_you_typed_match(match.is_history_what_you_typed_match), | 87 is_history_what_you_typed_match(match.is_history_what_you_typed_match), |
85 type(match.type), | 88 type(match.type), |
86 associated_keyword(match.associated_keyword.get() ? | 89 associated_keyword(match.associated_keyword.get() ? |
(...skipping 14 matching lines...) Expand all Loading... |
101 const AutocompleteMatch& match) { | 104 const AutocompleteMatch& match) { |
102 if (this == &match) | 105 if (this == &match) |
103 return *this; | 106 return *this; |
104 | 107 |
105 provider = match.provider; | 108 provider = match.provider; |
106 relevance = match.relevance; | 109 relevance = match.relevance; |
107 typed_count = match.typed_count; | 110 typed_count = match.typed_count; |
108 deletable = match.deletable; | 111 deletable = match.deletable; |
109 fill_into_edit = match.fill_into_edit; | 112 fill_into_edit = match.fill_into_edit; |
110 inline_autocomplete_offset = match.inline_autocomplete_offset; | 113 inline_autocomplete_offset = match.inline_autocomplete_offset; |
| 114 allowed_to_be_default_match = match.allowed_to_be_default_match; |
111 destination_url = match.destination_url; | 115 destination_url = match.destination_url; |
112 stripped_destination_url = match.stripped_destination_url; | 116 stripped_destination_url = match.stripped_destination_url; |
113 contents = match.contents; | 117 contents = match.contents; |
114 contents_class = match.contents_class; | 118 contents_class = match.contents_class; |
115 description = match.description; | 119 description = match.description; |
116 description_class = match.description_class; | 120 description_class = match.description_class; |
117 transition = match.transition; | 121 transition = match.transition; |
118 is_history_what_you_typed_match = match.is_history_what_you_typed_match; | 122 is_history_what_you_typed_match = match.is_history_what_you_typed_match; |
119 type = match.type; | 123 type = match.type; |
120 associated_keyword.reset(match.associated_keyword.get() ? | 124 associated_keyword.reset(match.associated_keyword.get() ? |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 << " is unsorted in relation to last offset of " << last_offset | 477 << " is unsorted in relation to last offset of " << last_offset |
474 << ". Provider: " << provider_name << "."; | 478 << ". Provider: " << provider_name << "."; |
475 DCHECK_LT(i->offset, text.length()) | 479 DCHECK_LT(i->offset, text.length()) |
476 << " Classification of [" << i->offset << "," << text.length() | 480 << " Classification of [" << i->offset << "," << text.length() |
477 << "] is out of bounds for \"" << text << "\". Provider: " | 481 << "] is out of bounds for \"" << text << "\". Provider: " |
478 << provider_name << "."; | 482 << provider_name << "."; |
479 last_offset = i->offset; | 483 last_offset = i->offset; |
480 } | 484 } |
481 } | 485 } |
482 #endif | 486 #endif |
OLD | NEW |