| 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_controller.h" | 5 #include "chrome/browser/autocomplete/autocomplete_controller.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 } | 422 } |
| 423 | 423 |
| 424 if (regenerate_result) | 424 if (regenerate_result) |
| 425 result_.Reset(); | 425 result_.Reset(); |
| 426 | 426 |
| 427 AutocompleteResult last_result; | 427 AutocompleteResult last_result; |
| 428 last_result.Swap(&result_); | 428 last_result.Swap(&result_); |
| 429 | 429 |
| 430 for (Providers::const_iterator i(providers_.begin()); | 430 for (Providers::const_iterator i(providers_.begin()); |
| 431 i != providers_.end(); ++i) | 431 i != providers_.end(); ++i) |
| 432 result_.AppendMatches((*i)->matches()); | 432 result_.AppendMatches(input_, (*i)->matches()); |
| 433 | 433 |
| 434 // Sort the matches and trim to a small number of "best" matches. | 434 // Sort the matches and trim to a small number of "best" matches. |
| 435 result_.SortAndCull(input_, template_url_service_); | 435 result_.SortAndCull(input_, template_url_service_); |
| 436 | 436 |
| 437 // Need to validate before invoking CopyOldMatches as the old matches are not | 437 // Need to validate before invoking CopyOldMatches as the old matches are not |
| 438 // valid against the current input. | 438 // valid against the current input. |
| 439 #ifndef NDEBUG | 439 #ifndef NDEBUG |
| 440 result_.Validate(); | 440 result_.Validate(); |
| 441 #endif | 441 #endif |
| 442 | 442 |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 expire_timer_.Stop(); | 667 expire_timer_.Stop(); |
| 668 stop_timer_.Stop(); | 668 stop_timer_.Stop(); |
| 669 done_ = true; | 669 done_ = true; |
| 670 if (clear_result && !result_.empty()) { | 670 if (clear_result && !result_.empty()) { |
| 671 result_.Reset(); | 671 result_.Reset(); |
| 672 // NOTE: We pass in false since we're trying to only clear the popup, not | 672 // NOTE: We pass in false since we're trying to only clear the popup, not |
| 673 // touch the edit... this is all a mess and should be cleaned up :( | 673 // touch the edit... this is all a mess and should be cleaned up :( |
| 674 NotifyChanged(false); | 674 NotifyChanged(false); |
| 675 } | 675 } |
| 676 } | 676 } |
| OLD | NEW |