| 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 "components/omnibox/search_provider.h" | 5 #include "components/omnibox/search_provider.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "components/metrics/proto/omnibox_input_type.pb.h" | 22 #include "components/metrics/proto/omnibox_input_type.pb.h" |
| 23 #include "components/omnibox/autocomplete_provider_client.h" | 23 #include "components/omnibox/autocomplete_provider_client.h" |
| 24 #include "components/omnibox/autocomplete_provider_listener.h" | 24 #include "components/omnibox/autocomplete_provider_listener.h" |
| 25 #include "components/omnibox/autocomplete_result.h" | 25 #include "components/omnibox/autocomplete_result.h" |
| 26 #include "components/omnibox/keyword_provider.h" | 26 #include "components/omnibox/keyword_provider.h" |
| 27 #include "components/omnibox/omnibox_field_trial.h" | 27 #include "components/omnibox/omnibox_field_trial.h" |
| 28 #include "components/omnibox/url_prefix.h" | 28 #include "components/omnibox/url_prefix.h" |
| 29 #include "components/search/search.h" | 29 #include "components/search/search.h" |
| 30 #include "components/search_engines/template_url_prepopulate_data.h" | 30 #include "components/search_engines/template_url_prepopulate_data.h" |
| 31 #include "components/search_engines/template_url_service.h" | 31 #include "components/search_engines/template_url_service.h" |
| 32 #include "components/variations/variations_http_header_provider.h" | 32 #include "components/variations/net/variations_http_header_provider.h" |
| 33 #include "grit/components_strings.h" | 33 #include "grit/components_strings.h" |
| 34 #include "net/base/escape.h" | 34 #include "net/base/escape.h" |
| 35 #include "net/base/load_flags.h" | 35 #include "net/base/load_flags.h" |
| 36 #include "net/base/net_util.h" | 36 #include "net/base/net_util.h" |
| 37 #include "net/http/http_request_headers.h" | 37 #include "net/http/http_request_headers.h" |
| 38 #include "net/url_request/url_fetcher.h" | 38 #include "net/url_request/url_fetcher.h" |
| 39 #include "net/url_request/url_request_status.h" | 39 #include "net/url_request/url_request_status.h" |
| 40 #include "ui/base/l10n/l10n_util.h" | 40 #include "ui/base/l10n/l10n_util.h" |
| 41 #include "url/url_constants.h" | 41 #include "url/url_constants.h" |
| 42 #include "url/url_util.h" | 42 #include "url/url_util.h" |
| (...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1431 for (MatchMap::const_iterator i(map.begin()); i != map.end(); ++i) | 1431 for (MatchMap::const_iterator i(map.begin()); i != map.end(); ++i) |
| 1432 matches.push_back(i->second); | 1432 matches.push_back(i->second); |
| 1433 std::sort(matches.begin(), matches.end(), &AutocompleteMatch::MoreRelevant); | 1433 std::sort(matches.begin(), matches.end(), &AutocompleteMatch::MoreRelevant); |
| 1434 | 1434 |
| 1435 // If there is a top scoring entry, find the corresponding answer. | 1435 // If there is a top scoring entry, find the corresponding answer. |
| 1436 if (!matches.empty()) | 1436 if (!matches.empty()) |
| 1437 return answers_cache_.GetTopAnswerEntry(matches[0].contents); | 1437 return answers_cache_.GetTopAnswerEntry(matches[0].contents); |
| 1438 | 1438 |
| 1439 return AnswersQueryData(); | 1439 return AnswersQueryData(); |
| 1440 } | 1440 } |
| OLD | NEW |