OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/ui/search/instant_controller.h" | 5 #include "chrome/browser/ui/search/instant_controller.h" |
6 | 6 |
7 #include <iterator> | 7 #include <iterator> |
8 | 8 |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
614 for (AutocompleteResult::const_iterator match(autocomplete_result.begin()); | 614 for (AutocompleteResult::const_iterator match(autocomplete_result.begin()); |
615 match != autocomplete_result.end(); ++match) { | 615 match != autocomplete_result.end(); ++match) { |
616 InstantAutocompleteResult result; | 616 InstantAutocompleteResult result; |
617 PopulateInstantAutocompleteResultFromMatch( | 617 PopulateInstantAutocompleteResultFromMatch( |
618 *match, std::distance(autocomplete_result.begin(), match), &result); | 618 *match, std::distance(autocomplete_result.begin(), match), &result); |
619 results.push_back(result); | 619 results.push_back(result); |
620 } | 620 } |
621 } else { | 621 } else { |
622 for (ACProviders::const_iterator provider = providers.begin(); | 622 for (ACProviders::const_iterator provider = providers.begin(); |
623 provider != providers.end(); ++provider) { | 623 provider != providers.end(); ++provider) { |
624 // We are talking to remote NTP, skip SearchProvider, since it only echoes | |
625 // suggestions. | |
626 if ((*provider)->type() == AutocompleteProvider::TYPE_SEARCH) | |
627 continue; | |
628 | |
sreeram
2013/05/24 21:00:59
This will end up sending NAVSUGGEST as well, re-in
Jered
2013/05/28 17:25:30
Done.
| |
629 for (ACMatches::const_iterator match = (*provider)->matches().begin(); | 624 for (ACMatches::const_iterator match = (*provider)->matches().begin(); |
630 match != (*provider)->matches().end(); ++match) { | 625 match != (*provider)->matches().end(); ++match) { |
631 InstantAutocompleteResult result; | 626 InstantAutocompleteResult result; |
632 PopulateInstantAutocompleteResultFromMatch(*match, kNoMatchIndex, | 627 PopulateInstantAutocompleteResultFromMatch(*match, kNoMatchIndex, |
633 &result); | 628 &result); |
634 results.push_back(result); | 629 results.push_back(result); |
635 } | 630 } |
636 } | 631 } |
637 } | 632 } |
638 LOG_INSTANT_DEBUG_EVENT(this, base::StringPrintf( | 633 LOG_INSTANT_DEBUG_EVENT(this, base::StringPrintf( |
(...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1834 | 1829 |
1835 result->transition = match.transition; | 1830 result->transition = match.transition; |
1836 result->relevance = match.relevance; | 1831 result->relevance = match.relevance; |
1837 result->autocomplete_match_index = autocomplete_match_index; | 1832 result->autocomplete_match_index = autocomplete_match_index; |
1838 | 1833 |
1839 DVLOG(1) << " " << result->relevance << " " << result->type << " " | 1834 DVLOG(1) << " " << result->relevance << " " << result->type << " " |
1840 << result->provider << " " << result->destination_url << " '" | 1835 << result->provider << " " << result->destination_url << " '" |
1841 << result->description << "' '" << result->search_query << "' " | 1836 << result->description << "' '" << result->search_query << "' " |
1842 << result->transition << " " << result->autocomplete_match_index; | 1837 << result->transition << " " << result->autocomplete_match_index; |
1843 } | 1838 } |
OLD | NEW |