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" |
11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
12 #include "chrome/browser/history/history_service.h" | 13 #include "chrome/browser/history/history_service.h" |
13 #include "chrome/browser/history/history_service_factory.h" | 14 #include "chrome/browser/history/history_service_factory.h" |
14 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
16 #include "components/bookmarks/browser/bookmark_model.h" | 17 #include "components/bookmarks/browser/bookmark_model.h" |
17 #include "components/history/core/browser/in_memory_url_index_types.h" | |
18 #include "components/omnibox/autocomplete_input.h" | 18 #include "components/omnibox/autocomplete_input.h" |
19 #include "components/omnibox/autocomplete_match.h" | 19 #include "components/omnibox/autocomplete_match.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); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 do { | 102 do { |
103 offset += matches[i].length; | 103 offset += matches[i].length; |
104 ++i; | 104 ++i; |
105 } while ((i < match_count) && (offset == matches[i].offset)); | 105 } while ((i < match_count) && (offset == matches[i].offset)); |
106 if (offset < text_length) | 106 if (offset < text_length) |
107 spans.push_back(ACMatchClassification(offset, url_style)); | 107 spans.push_back(ACMatchClassification(offset, url_style)); |
108 } | 108 } |
109 | 109 |
110 return spans; | 110 return spans; |
111 } | 111 } |
OLD | NEW |