| 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/autocomplete/search_provider.h" | 5 #include "chrome/browser/autocomplete/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 22 matching lines...) Expand all Loading... |
| 33 #include "components/history/core/browser/in_memory_database.h" | 33 #include "components/history/core/browser/in_memory_database.h" |
| 34 #include "components/history/core/browser/keyword_search_term.h" | 34 #include "components/history/core/browser/keyword_search_term.h" |
| 35 #include "components/metrics/proto/omnibox_input_type.pb.h" | 35 #include "components/metrics/proto/omnibox_input_type.pb.h" |
| 36 #include "components/omnibox/autocomplete_provider_listener.h" | 36 #include "components/omnibox/autocomplete_provider_listener.h" |
| 37 #include "components/omnibox/url_prefix.h" | 37 #include "components/omnibox/url_prefix.h" |
| 38 #include "components/search/search.h" | 38 #include "components/search/search.h" |
| 39 #include "components/search_engines/template_url_prepopulate_data.h" | 39 #include "components/search_engines/template_url_prepopulate_data.h" |
| 40 #include "components/search_engines/template_url_service.h" | 40 #include "components/search_engines/template_url_service.h" |
| 41 #include "components/variations/variations_http_header_provider.h" | 41 #include "components/variations/variations_http_header_provider.h" |
| 42 #include "content/public/browser/user_metrics.h" | 42 #include "content/public/browser/user_metrics.h" |
| 43 #include "grit/generated_resources.h" | 43 #include "grit/components_strings.h" |
| 44 #include "net/base/escape.h" | 44 #include "net/base/escape.h" |
| 45 #include "net/base/load_flags.h" | 45 #include "net/base/load_flags.h" |
| 46 #include "net/base/net_util.h" | 46 #include "net/base/net_util.h" |
| 47 #include "net/http/http_request_headers.h" | 47 #include "net/http/http_request_headers.h" |
| 48 #include "net/url_request/url_fetcher.h" | 48 #include "net/url_request/url_fetcher.h" |
| 49 #include "net/url_request/url_request_status.h" | 49 #include "net/url_request/url_request_status.h" |
| 50 #include "ui/base/l10n/l10n_util.h" | 50 #include "ui/base/l10n/l10n_util.h" |
| 51 #include "url/url_constants.h" | 51 #include "url/url_constants.h" |
| 52 #include "url/url_util.h" | 52 #include "url/url_util.h" |
| 53 | 53 |
| (...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1241 last_answer_seen_.query_type = match->answer_type; | 1241 last_answer_seen_.query_type = match->answer_type; |
| 1242 } | 1242 } |
| 1243 | 1243 |
| 1244 void SearchProvider::DoAnswersQuery(const AutocompleteInput& input) { | 1244 void SearchProvider::DoAnswersQuery(const AutocompleteInput& input) { |
| 1245 // If the query text starts with trimmed input, this is valid prefetch data. | 1245 // If the query text starts with trimmed input, this is valid prefetch data. |
| 1246 prefetch_data_ = StartsWith(last_answer_seen_.full_query_text, | 1246 prefetch_data_ = StartsWith(last_answer_seen_.full_query_text, |
| 1247 base::CollapseWhitespace(input.text(), false), | 1247 base::CollapseWhitespace(input.text(), false), |
| 1248 false) ? | 1248 false) ? |
| 1249 last_answer_seen_ : AnswersQueryData(); | 1249 last_answer_seen_ : AnswersQueryData(); |
| 1250 } | 1250 } |
| OLD | NEW |