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_provider.h" | 5 #include "chrome/browser/autocomplete/history_provider.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
12 #include "chrome/browser/history/history_service.h" | 12 #include "chrome/browser/history/history_service.h" |
13 #include "chrome/browser/history/history_service_factory.h" | 13 #include "chrome/browser/history/history_service_factory.h" |
14 #include "chrome/browser/history/in_memory_url_index_types.h" | 14 #include "chrome/browser/history/in_memory_url_index_types.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
17 #include "components/autocomplete/autocomplete_input.h" | |
18 #include "components/autocomplete/autocomplete_match.h" | |
19 #include "components/bookmarks/browser/bookmark_model.h" | 17 #include "components/bookmarks/browser/bookmark_model.h" |
| 18 #include "components/omnibox/autocomplete_input.h" |
| 19 #include "components/omnibox/autocomplete_match.h" |
20 #include "url/url_util.h" | 20 #include "url/url_util.h" |
21 | 21 |
22 void HistoryProvider::DeleteMatch(const AutocompleteMatch& match) { | 22 void HistoryProvider::DeleteMatch(const AutocompleteMatch& match) { |
23 DCHECK(done_); | 23 DCHECK(done_); |
24 DCHECK(profile_); | 24 DCHECK(profile_); |
25 DCHECK(match.deletable); | 25 DCHECK(match.deletable); |
26 | 26 |
27 HistoryService* const history_service = | 27 HistoryService* const history_service = |
28 HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); | 28 HistoryServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); |
29 | 29 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 do { | 100 do { |
101 offset += matches[i].length; | 101 offset += matches[i].length; |
102 ++i; | 102 ++i; |
103 } while ((i < match_count) && (offset == matches[i].offset)); | 103 } while ((i < match_count) && (offset == matches[i].offset)); |
104 if (offset < text_length) | 104 if (offset < text_length) |
105 spans.push_back(ACMatchClassification(offset, url_style)); | 105 spans.push_back(ACMatchClassification(offset, url_style)); |
106 } | 106 } |
107 | 107 |
108 return spans; | 108 return spans; |
109 } | 109 } |
OLD | NEW |