| 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.h" | 5 #include "chrome/browser/autocomplete/autocomplete.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 // Sort the matches and trim to a small number of "best" matches. | 1000 // Sort the matches and trim to a small number of "best" matches. |
| 1001 result_.SortAndCull(input_); | 1001 result_.SortAndCull(input_); |
| 1002 | 1002 |
| 1003 // Need to validate before invoking CopyOldMatches as the old matches are not | 1003 // Need to validate before invoking CopyOldMatches as the old matches are not |
| 1004 // valid against the current input. | 1004 // valid against the current input. |
| 1005 #ifndef NDEBUG | 1005 #ifndef NDEBUG |
| 1006 result_.Validate(); | 1006 result_.Validate(); |
| 1007 #endif | 1007 #endif |
| 1008 | 1008 |
| 1009 if (!done_) { | 1009 if (!done_) { |
| 1010 // This conditional needs to match the conditional in Start that invokes | 1010 // This must match the conditional in Start that invokes StartExpireTimer. |
| 1011 // StartExpireTimer. | 1011 // TODO(msw): Remove or sanitize copied SEARCH_SUGGEST matches? |
| 1012 result_.CopyOldMatches(input_, last_result); | 1012 result_.CopyOldMatches(input_, last_result); |
| 1013 } | 1013 } |
| 1014 | 1014 |
| 1015 UpdateKeywordDescriptions(&result_); | 1015 UpdateKeywordDescriptions(&result_); |
| 1016 UpdateAssociatedKeywords(&result_); | 1016 UpdateAssociatedKeywords(&result_); |
| 1017 | 1017 |
| 1018 bool notify_default_match = is_synchronous_pass; | 1018 bool notify_default_match = is_synchronous_pass; |
| 1019 if (!is_synchronous_pass) { | 1019 if (!is_synchronous_pass) { |
| 1020 const bool last_default_was_valid = | 1020 const bool last_default_was_valid = |
| 1021 last_result.default_match() != last_result.end(); | 1021 last_result.default_match() != last_result.end(); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1138 const AutocompleteResult& result) | 1138 const AutocompleteResult& result) |
| 1139 : text(text), | 1139 : text(text), |
| 1140 input_type(input_type), | 1140 input_type(input_type), |
| 1141 selected_index(selected_index), | 1141 selected_index(selected_index), |
| 1142 tab_id(tab_id), | 1142 tab_id(tab_id), |
| 1143 elapsed_time_since_user_first_modified_omnibox( | 1143 elapsed_time_since_user_first_modified_omnibox( |
| 1144 elapsed_time_since_user_first_modified_omnibox), | 1144 elapsed_time_since_user_first_modified_omnibox), |
| 1145 inline_autocompleted_length(inline_autocompleted_length), | 1145 inline_autocompleted_length(inline_autocompleted_length), |
| 1146 result(result) { | 1146 result(result) { |
| 1147 } | 1147 } |
| OLD | NEW |