Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "components/omnibox/browser/autocomplete_match.h" | 5 #include "components/omnibox/browser/autocomplete_match.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 contents(match.contents), | 116 contents(match.contents), |
| 117 contents_class(match.contents_class), | 117 contents_class(match.contents_class), |
| 118 description(match.description), | 118 description(match.description), |
| 119 description_class(match.description_class), | 119 description_class(match.description_class), |
| 120 swap_contents_and_description(match.swap_contents_and_description), | 120 swap_contents_and_description(match.swap_contents_and_description), |
| 121 answer_contents(match.answer_contents), | 121 answer_contents(match.answer_contents), |
| 122 answer_type(match.answer_type), | 122 answer_type(match.answer_type), |
| 123 answer(SuggestionAnswer::copy(match.answer.get())), | 123 answer(SuggestionAnswer::copy(match.answer.get())), |
| 124 transition(match.transition), | 124 transition(match.transition), |
| 125 type(match.type), | 125 type(match.type), |
| 126 associated_keyword(match.associated_keyword.get() ? | 126 specific_type_identifier(match.specific_type_identifier), |
| 127 new AutocompleteMatch(*match.associated_keyword) : NULL), | 127 associated_keyword(match.associated_keyword.get() |
| 128 ? new AutocompleteMatch(*match.associated_keyword) | |
| 129 : NULL), | |
| 128 keyword(match.keyword), | 130 keyword(match.keyword), |
| 129 from_previous(match.from_previous), | 131 from_previous(match.from_previous), |
| 130 search_terms_args(match.search_terms_args.get() ? | 132 search_terms_args( |
| 131 new TemplateURLRef::SearchTermsArgs(*match.search_terms_args) : | 133 match.search_terms_args.get() |
| 132 NULL), | 134 ? new TemplateURLRef::SearchTermsArgs(*match.search_terms_args) |
| 135 : NULL), | |
| 133 additional_info(match.additional_info), | 136 additional_info(match.additional_info), |
| 134 duplicate_matches(match.duplicate_matches) { | 137 duplicate_matches(match.duplicate_matches) {} |
| 135 } | |
| 136 | 138 |
| 137 AutocompleteMatch::~AutocompleteMatch() { | 139 AutocompleteMatch::~AutocompleteMatch() { |
| 138 } | 140 } |
| 139 | 141 |
| 140 AutocompleteMatch& AutocompleteMatch::operator=( | 142 AutocompleteMatch& AutocompleteMatch::operator=( |
| 141 const AutocompleteMatch& match) { | 143 const AutocompleteMatch& match) { |
| 142 if (this == &match) | 144 if (this == &match) |
| 143 return *this; | 145 return *this; |
| 144 | 146 |
| 145 provider = match.provider; | 147 provider = match.provider; |
| 146 relevance = match.relevance; | 148 relevance = match.relevance; |
| 147 typed_count = match.typed_count; | 149 typed_count = match.typed_count; |
| 148 deletable = match.deletable; | 150 deletable = match.deletable; |
| 149 fill_into_edit = match.fill_into_edit; | 151 fill_into_edit = match.fill_into_edit; |
| 150 inline_autocompletion = match.inline_autocompletion; | 152 inline_autocompletion = match.inline_autocompletion; |
| 151 allowed_to_be_default_match = match.allowed_to_be_default_match; | 153 allowed_to_be_default_match = match.allowed_to_be_default_match; |
| 152 destination_url = match.destination_url; | 154 destination_url = match.destination_url; |
| 153 stripped_destination_url = match.stripped_destination_url; | 155 stripped_destination_url = match.stripped_destination_url; |
| 154 contents = match.contents; | 156 contents = match.contents; |
| 155 contents_class = match.contents_class; | 157 contents_class = match.contents_class; |
| 156 description = match.description; | 158 description = match.description; |
| 157 description_class = match.description_class; | 159 description_class = match.description_class; |
| 158 swap_contents_and_description = match.swap_contents_and_description; | 160 swap_contents_and_description = match.swap_contents_and_description; |
| 159 answer_contents = match.answer_contents; | 161 answer_contents = match.answer_contents; |
| 160 answer_type = match.answer_type; | 162 answer_type = match.answer_type; |
| 161 answer = SuggestionAnswer::copy(match.answer.get()); | 163 answer = SuggestionAnswer::copy(match.answer.get()); |
| 162 transition = match.transition; | 164 transition = match.transition; |
| 163 type = match.type; | 165 type = match.type; |
| 166 specific_type_identifier = match.specific_type_identifier; | |
|
Mark P
2017/03/21 19:54:24
Nice work. Most times I review changes to Autocom
| |
| 164 associated_keyword.reset(match.associated_keyword.get() ? | 167 associated_keyword.reset(match.associated_keyword.get() ? |
| 165 new AutocompleteMatch(*match.associated_keyword) : NULL); | 168 new AutocompleteMatch(*match.associated_keyword) : NULL); |
| 166 keyword = match.keyword; | 169 keyword = match.keyword; |
| 167 from_previous = match.from_previous; | 170 from_previous = match.from_previous; |
| 168 search_terms_args.reset(match.search_terms_args.get() ? | 171 search_terms_args.reset(match.search_terms_args.get() ? |
| 169 new TemplateURLRef::SearchTermsArgs(*match.search_terms_args) : NULL); | 172 new TemplateURLRef::SearchTermsArgs(*match.search_terms_args) : NULL); |
| 170 additional_info = match.additional_info; | 173 additional_info = match.additional_info; |
| 171 duplicate_matches = match.duplicate_matches; | 174 duplicate_matches = match.duplicate_matches; |
| 172 return *this; | 175 return *this; |
| 173 } | 176 } |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 620 << " is unsorted in relation to last offset of " << last_offset | 623 << " is unsorted in relation to last offset of " << last_offset |
| 621 << ". Provider: " << provider_name << "."; | 624 << ". Provider: " << provider_name << "."; |
| 622 DCHECK_LT(i->offset, text.length()) | 625 DCHECK_LT(i->offset, text.length()) |
| 623 << " Classification of [" << i->offset << "," << text.length() | 626 << " Classification of [" << i->offset << "," << text.length() |
| 624 << "] is out of bounds for \"" << text << "\". Provider: " | 627 << "] is out of bounds for \"" << text << "\". Provider: " |
| 625 << provider_name << "."; | 628 << provider_name << "."; |
| 626 last_offset = i->offset; | 629 last_offset = i->offset; |
| 627 } | 630 } |
| 628 } | 631 } |
| 629 #endif | 632 #endif |
| OLD | NEW |