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/history_url_provider.h" | 5 #include "chrome/browser/autocomplete/history_url_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "components/omnibox/autocomplete_provider_listener.h" | 35 #include "components/omnibox/autocomplete_provider_listener.h" |
36 #include "components/omnibox/autocomplete_result.h" | 36 #include "components/omnibox/autocomplete_result.h" |
37 #include "components/omnibox/omnibox_field_trial.h" | 37 #include "components/omnibox/omnibox_field_trial.h" |
38 #include "components/omnibox/url_prefix.h" | 38 #include "components/omnibox/url_prefix.h" |
39 #include "components/search_engines/template_url_service.h" | 39 #include "components/search_engines/template_url_service.h" |
40 #include "components/url_fixer/url_fixer.h" | 40 #include "components/url_fixer/url_fixer.h" |
41 #include "content/public/browser/browser_thread.h" | 41 #include "content/public/browser/browser_thread.h" |
42 #include "net/base/net_util.h" | 42 #include "net/base/net_util.h" |
43 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 43 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
44 #include "url/gurl.h" | 44 #include "url/gurl.h" |
45 #include "url/url_parse.h" | 45 #include "url/third_party/mozilla/url_parse.h" |
46 #include "url/url_util.h" | 46 #include "url/url_util.h" |
47 | 47 |
48 namespace { | 48 namespace { |
49 | 49 |
50 // Acts like the > operator for URLInfo classes. | 50 // Acts like the > operator for URLInfo classes. |
51 bool CompareHistoryMatch(const history::HistoryMatch& a, | 51 bool CompareHistoryMatch(const history::HistoryMatch& a, |
52 const history::HistoryMatch& b) { | 52 const history::HistoryMatch& b) { |
53 // A URL that has been typed at all is better than one that has never been | 53 // A URL that has been typed at all is better than one that has never been |
54 // typed. (Note "!"s on each side) | 54 // typed. (Note "!"s on each side) |
55 if (!a.url_info.typed_count() != !b.url_info.typed_count()) | 55 if (!a.url_info.typed_count() != !b.url_info.typed_count()) |
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0, | 1179 AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0, |
1180 match.contents.length(), ACMatchClassification::URL, | 1180 match.contents.length(), ACMatchClassification::URL, |
1181 &match.contents_class); | 1181 &match.contents_class); |
1182 } | 1182 } |
1183 match.description = info.title(); | 1183 match.description = info.title(); |
1184 match.description_class = | 1184 match.description_class = |
1185 ClassifyDescription(params.input.text(), match.description); | 1185 ClassifyDescription(params.input.text(), match.description); |
1186 RecordAdditionalInfoFromUrlRow(info, &match); | 1186 RecordAdditionalInfoFromUrlRow(info, &match); |
1187 return match; | 1187 return match; |
1188 } | 1188 } |
OLD | NEW |