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