Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: chrome/browser/autocomplete/history_provider.cc

Issue 1178203004: Componentize InMemoryURLIndexTypes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/history_provider.h ('k') | chrome/browser/autocomplete/history_quick_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698