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/bookmark_provider.h" | 5 #include "chrome/browser/autocomplete/bookmark_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/prefs/pref_service.h" |
12 #include "base/time.h" | 13 #include "base/time.h" |
13 #include "chrome/browser/autocomplete/autocomplete_result.h" | 14 #include "chrome/browser/autocomplete/autocomplete_result.h" |
14 #include "chrome/browser/bookmarks/bookmark_model.h" | 15 #include "chrome/browser/bookmarks/bookmark_model.h" |
15 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
16 #include "chrome/browser/prefs/pref_service.h" | |
17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
19 #include "net/base/net_util.h" | 19 #include "net/base/net_util.h" |
20 | 20 |
21 typedef std::vector<bookmark_utils::TitleMatch> TitleMatches; | 21 typedef std::vector<bookmark_utils::TitleMatch> TitleMatches; |
22 | 22 |
23 // BookmarkProvider ------------------------------------------------------------ | 23 // BookmarkProvider ------------------------------------------------------------ |
24 | 24 |
25 BookmarkProvider::BookmarkProvider( | 25 BookmarkProvider::BookmarkProvider( |
26 AutocompleteProviderListener* listener, | 26 AutocompleteProviderListener* listener, |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 for (Snippet::MatchPositions::const_iterator i = positions.begin(); | 263 for (Snippet::MatchPositions::const_iterator i = positions.begin(); |
264 i != positions.end(); ++i) { | 264 i != positions.end(); ++i) { |
265 AutocompleteMatch::ACMatchClassifications new_class; | 265 AutocompleteMatch::ACMatchClassifications new_class; |
266 AutocompleteMatch::ClassifyLocationInString(i->first, i->second - i->first, | 266 AutocompleteMatch::ClassifyLocationInString(i->first, i->second - i->first, |
267 text_length, 0, &new_class); | 267 text_length, 0, &new_class); |
268 classifications = AutocompleteMatch::MergeClassifications( | 268 classifications = AutocompleteMatch::MergeClassifications( |
269 classifications, new_class); | 269 classifications, new_class); |
270 } | 270 } |
271 return classifications; | 271 return classifications; |
272 } | 272 } |
OLD | NEW |