| 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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 } | 886 } |
| 887 | 887 |
| 888 AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch( | 888 AutocompleteMatch HistoryURLProvider::HistoryMatchToACMatch( |
| 889 HistoryURLProviderParams* params, | 889 HistoryURLProviderParams* params, |
| 890 const history::HistoryMatch& history_match, | 890 const history::HistoryMatch& history_match, |
| 891 MatchType match_type, | 891 MatchType match_type, |
| 892 int relevance) { | 892 int relevance) { |
| 893 const history::URLRow& info = history_match.url_info; | 893 const history::URLRow& info = history_match.url_info; |
| 894 AutocompleteMatch match(this, relevance, | 894 AutocompleteMatch match(this, relevance, |
| 895 !!info.visit_count(), AutocompleteMatch::HISTORY_URL); | 895 !!info.visit_count(), AutocompleteMatch::HISTORY_URL); |
| 896 match.typed_count = info.typed_count(); |
| 896 match.destination_url = info.url(); | 897 match.destination_url = info.url(); |
| 897 DCHECK(match.destination_url.is_valid()); | 898 DCHECK(match.destination_url.is_valid()); |
| 898 size_t inline_autocomplete_offset = | 899 size_t inline_autocomplete_offset = |
| 899 history_match.input_location + params->input.text().length(); | 900 history_match.input_location + params->input.text().length(); |
| 900 std::string languages = (match_type == WHAT_YOU_TYPED) ? | 901 std::string languages = (match_type == WHAT_YOU_TYPED) ? |
| 901 std::string() : params->languages; | 902 std::string() : params->languages; |
| 902 const net::FormatUrlTypes format_types = net::kFormatUrlOmitAll & | 903 const net::FormatUrlTypes format_types = net::kFormatUrlOmitAll & |
| 903 ~((params->trim_http && !history_match.match_in_scheme) ? | 904 ~((params->trim_http && !history_match.match_in_scheme) ? |
| 904 0 : net::kFormatUrlOmitHTTP); | 905 0 : net::kFormatUrlOmitHTTP); |
| 905 match.fill_into_edit = | 906 match.fill_into_edit = |
| (...skipping 22 matching lines...) Expand all Loading... |
| 928 &match.contents_class); | 929 &match.contents_class); |
| 929 } | 930 } |
| 930 match.description = info.title(); | 931 match.description = info.title(); |
| 931 AutocompleteMatch::ClassifyMatchInString(params->input.text(), | 932 AutocompleteMatch::ClassifyMatchInString(params->input.text(), |
| 932 info.title(), | 933 info.title(), |
| 933 ACMatchClassification::NONE, | 934 ACMatchClassification::NONE, |
| 934 &match.description_class); | 935 &match.description_class); |
| 935 | 936 |
| 936 return match; | 937 return match; |
| 937 } | 938 } |
| OLD | NEW |