| 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 15 matching lines...) Expand all Loading... |
| 26 #include "chrome/browser/history/in_memory_url_index_types.h" | 26 #include "chrome/browser/history/in_memory_url_index_types.h" |
| 27 #include "chrome/browser/history/scored_history_match.h" | 27 #include "chrome/browser/history/scored_history_match.h" |
| 28 #include "chrome/browser/omnibox/omnibox_field_trial.h" | 28 #include "chrome/browser/omnibox/omnibox_field_trial.h" |
| 29 #include "chrome/browser/profiles/profile.h" | 29 #include "chrome/browser/profiles/profile.h" |
| 30 #include "chrome/browser/search_engines/template_url_service.h" | 30 #include "chrome/browser/search_engines/template_url_service.h" |
| 31 #include "chrome/browser/search_engines/template_url_service_factory.h" | 31 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 32 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
| 33 #include "chrome/common/net/url_fixer_upper.h" | 33 #include "chrome/common/net/url_fixer_upper.h" |
| 34 #include "chrome/common/pref_names.h" | 34 #include "chrome/common/pref_names.h" |
| 35 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
| 36 #include "components/bookmarks/core/browser/bookmark_utils.h" | 36 #include "components/bookmarks/browser/bookmark_utils.h" |
| 37 #include "net/base/net_util.h" | 37 #include "net/base/net_util.h" |
| 38 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 38 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 39 #include "url/gurl.h" | 39 #include "url/gurl.h" |
| 40 #include "url/url_parse.h" | 40 #include "url/url_parse.h" |
| 41 #include "url/url_util.h" | 41 #include "url/url_util.h" |
| 42 | 42 |
| 43 namespace { | 43 namespace { |
| 44 | 44 |
| 45 // If |create_if_necessary| is true, ensures that |matches| contains an | 45 // If |create_if_necessary| is true, ensures that |matches| contains an |
| 46 // entry for |info|, creating a new such entry if necessary (using | 46 // entry for |info|, creating a new such entry if necessary (using |
| (...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 // If HistoryURL retrieves any matches (and hence we reach this code), we | 1158 // If HistoryURL retrieves any matches (and hence we reach this code), we |
| 1159 // are guaranteed that the beginning of input_text must be a word break. | 1159 // are guaranteed that the beginning of input_text must be a word break. |
| 1160 history::WordStarts offsets(1, 0u); | 1160 history::WordStarts offsets(1, 0u); |
| 1161 description_matches = | 1161 description_matches = |
| 1162 history::ScoredHistoryMatch::FilterTermMatchesByWordStarts( | 1162 history::ScoredHistoryMatch::FilterTermMatchesByWordStarts( |
| 1163 description_matches, offsets, description_word_starts, 0, | 1163 description_matches, offsets, description_word_starts, 0, |
| 1164 std::string::npos); | 1164 std::string::npos); |
| 1165 return SpansFromTermMatch( | 1165 return SpansFromTermMatch( |
| 1166 description_matches, clean_description.length(), false); | 1166 description_matches, clean_description.length(), false); |
| 1167 } | 1167 } |
| OLD | NEW |