OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_quick_provider.h" | 5 #include "chrome/browser/autocomplete/history_quick_provider.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/i18n/break_iterator.h" | 10 #include "base/i18n/break_iterator.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/common/pref_names.h" | 23 #include "chrome/common/pref_names.h" |
24 #include "chrome/common/url_constants.h" | 24 #include "chrome/common/url_constants.h" |
25 #include "content/public/browser/notification_source.h" | 25 #include "content/public/browser/notification_source.h" |
26 #include "content/public/browser/notification_types.h" | 26 #include "content/public/browser/notification_types.h" |
27 #include "googleurl/src/url_parse.h" | 27 #include "googleurl/src/url_parse.h" |
28 #include "googleurl/src/url_util.h" | 28 #include "googleurl/src/url_util.h" |
29 #include "net/base/escape.h" | 29 #include "net/base/escape.h" |
30 #include "net/base/net_util.h" | 30 #include "net/base/net_util.h" |
31 | 31 |
32 using history::InMemoryURLIndex; | |
33 using history::ScoredHistoryMatch; | 32 using history::ScoredHistoryMatch; |
34 using history::ScoredHistoryMatches; | 33 using history::ScoredHistoryMatches; |
35 | 34 |
36 bool HistoryQuickProvider::disabled_ = false; | 35 bool HistoryQuickProvider::disabled_ = false; |
37 | 36 |
38 HistoryQuickProvider::HistoryQuickProvider(ACProviderListener* listener, | 37 HistoryQuickProvider::HistoryQuickProvider(ACProviderListener* listener, |
39 Profile* profile) | 38 Profile* profile) |
40 : HistoryProvider(listener, profile, "HistoryQuickProvider"), | 39 : HistoryProvider(listener, profile, "HistoryQuickProvider"), |
41 languages_(profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)) {} | 40 languages_(profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)) {} |
42 | 41 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 do { | 208 do { |
210 offset += matches[i].length; | 209 offset += matches[i].length; |
211 ++i; | 210 ++i; |
212 } while ((i < match_count) && (offset == matches[i].offset)); | 211 } while ((i < match_count) && (offset == matches[i].offset)); |
213 if (offset < text_length) | 212 if (offset < text_length) |
214 spans.push_back(ACMatchClassification(offset, url_style)); | 213 spans.push_back(ACMatchClassification(offset, url_style)); |
215 } | 214 } |
216 | 215 |
217 return spans; | 216 return spans; |
218 } | 217 } |
OLD | NEW |