| 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/browser/search_provider.h" | 5 #include "components/omnibox/browser/search_provider.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "components/metrics/proto/omnibox_input_type.pb.h" | 27 #include "components/metrics/proto/omnibox_input_type.pb.h" |
| 28 #include "components/omnibox/browser/autocomplete_provider_client.h" | 28 #include "components/omnibox/browser/autocomplete_provider_client.h" |
| 29 #include "components/omnibox/browser/autocomplete_provider_listener.h" | 29 #include "components/omnibox/browser/autocomplete_provider_listener.h" |
| 30 #include "components/omnibox/browser/autocomplete_result.h" | 30 #include "components/omnibox/browser/autocomplete_result.h" |
| 31 #include "components/omnibox/browser/keyword_provider.h" | 31 #include "components/omnibox/browser/keyword_provider.h" |
| 32 #include "components/omnibox/browser/omnibox_field_trial.h" | 32 #include "components/omnibox/browser/omnibox_field_trial.h" |
| 33 #include "components/omnibox/browser/suggestion_answer.h" | 33 #include "components/omnibox/browser/suggestion_answer.h" |
| 34 #include "components/omnibox/browser/url_prefix.h" | 34 #include "components/omnibox/browser/url_prefix.h" |
| 35 #include "components/search/search.h" | 35 #include "components/search/search.h" |
| 36 #include "components/search_engines/template_url_service.h" | 36 #include "components/search_engines/template_url_service.h" |
| 37 #include "components/strings/grit/components_strings.h" |
| 37 #include "components/url_formatter/url_formatter.h" | 38 #include "components/url_formatter/url_formatter.h" |
| 38 #include "components/variations/net/variations_http_headers.h" | 39 #include "components/variations/net/variations_http_headers.h" |
| 39 #include "grit/components_strings.h" | |
| 40 #include "net/base/escape.h" | 40 #include "net/base/escape.h" |
| 41 #include "net/base/load_flags.h" | 41 #include "net/base/load_flags.h" |
| 42 #include "net/http/http_request_headers.h" | 42 #include "net/http/http_request_headers.h" |
| 43 #include "net/url_request/url_fetcher.h" | 43 #include "net/url_request/url_fetcher.h" |
| 44 #include "net/url_request/url_request_status.h" | 44 #include "net/url_request/url_request_status.h" |
| 45 #include "ui/base/l10n/l10n_util.h" | 45 #include "ui/base/l10n/l10n_util.h" |
| 46 #include "url/url_constants.h" | 46 #include "url/url_constants.h" |
| 47 #include "url/url_util.h" | 47 #include "url/url_util.h" |
| 48 | 48 |
| 49 // Helpers -------------------------------------------------------------------- | 49 // Helpers -------------------------------------------------------------------- |
| (...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1490 for (MatchMap::const_iterator i(map.begin()); i != map.end(); ++i) | 1490 for (MatchMap::const_iterator i(map.begin()); i != map.end(); ++i) |
| 1491 matches.push_back(i->second); | 1491 matches.push_back(i->second); |
| 1492 std::sort(matches.begin(), matches.end(), &AutocompleteMatch::MoreRelevant); | 1492 std::sort(matches.begin(), matches.end(), &AutocompleteMatch::MoreRelevant); |
| 1493 | 1493 |
| 1494 // If there is a top scoring entry, find the corresponding answer. | 1494 // If there is a top scoring entry, find the corresponding answer. |
| 1495 if (!matches.empty()) | 1495 if (!matches.empty()) |
| 1496 return answers_cache_.GetTopAnswerEntry(matches[0].contents); | 1496 return answers_cache_.GetTopAnswerEntry(matches[0].contents); |
| 1497 | 1497 |
| 1498 return AnswersQueryData(); | 1498 return AnswersQueryData(); |
| 1499 } | 1499 } |
| OLD | NEW |