| 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_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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 using history::InMemoryURLIndex; | 40 using history::InMemoryURLIndex; |
| 41 using history::ScoredHistoryMatch; | 41 using history::ScoredHistoryMatch; |
| 42 using history::ScoredHistoryMatches; | 42 using history::ScoredHistoryMatches; |
| 43 | 43 |
| 44 bool HistoryQuickProvider::disabled_ = false; | 44 bool HistoryQuickProvider::disabled_ = false; |
| 45 | 45 |
| 46 HistoryQuickProvider::HistoryQuickProvider( | 46 HistoryQuickProvider::HistoryQuickProvider( |
| 47 AutocompleteProviderListener* listener, | 47 AutocompleteProviderListener* listener, |
| 48 Profile* profile) | 48 Profile* profile) |
| 49 : HistoryProvider(listener, profile, "HistoryQuick"), | 49 : HistoryProvider(listener, |
| 50 profile, |
| 51 AutocompleteProvider::TYPE_HISTORY_QUICK), |
| 50 languages_(profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)), | 52 languages_(profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)), |
| 51 reorder_for_inlining_(false) { | 53 reorder_for_inlining_(false) { |
| 52 enum InliningOption { | 54 enum InliningOption { |
| 53 INLINING_PROHIBITED = 0, | 55 INLINING_PROHIBITED = 0, |
| 54 INLINING_ALLOWED = 1, | 56 INLINING_ALLOWED = 1, |
| 55 INLINING_AUTO_BUT_NOT_IN_FIELD_TRIAL = 2, | 57 INLINING_AUTO_BUT_NOT_IN_FIELD_TRIAL = 2, |
| 56 INLINING_FIELD_TRIAL_DEFAULT_GROUP = 3, | 58 INLINING_FIELD_TRIAL_DEFAULT_GROUP = 3, |
| 57 INLINING_FIELD_TRIAL_EXPERIMENT_GROUP = 4, | 59 INLINING_FIELD_TRIAL_EXPERIMENT_GROUP = 4, |
| 58 NUM_OPTIONS = 5 | 60 NUM_OPTIONS = 5 |
| 59 }; | 61 }; |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 do { | 290 do { |
| 289 offset += matches[i].length; | 291 offset += matches[i].length; |
| 290 ++i; | 292 ++i; |
| 291 } while ((i < match_count) && (offset == matches[i].offset)); | 293 } while ((i < match_count) && (offset == matches[i].offset)); |
| 292 if (offset < text_length) | 294 if (offset < text_length) |
| 293 spans.push_back(ACMatchClassification(offset, url_style)); | 295 spans.push_back(ACMatchClassification(offset, url_style)); |
| 294 } | 296 } |
| 295 | 297 |
| 296 return spans; | 298 return spans; |
| 297 } | 299 } |
| OLD | NEW |