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 "components/omnibox/browser/history_quick_provider.h" | 5 #include "components/omnibox/browser/history_quick_provider.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 in_memory_url_index_(client->GetInMemoryURLIndex()) { | 41 in_memory_url_index_(client->GetInMemoryURLIndex()) { |
42 } | 42 } |
43 | 43 |
44 void HistoryQuickProvider::Start(const AutocompleteInput& input, | 44 void HistoryQuickProvider::Start(const AutocompleteInput& input, |
45 bool minimal_changes) { | 45 bool minimal_changes) { |
46 TRACE_EVENT0("omnibox", "HistoryQuickProvider::Start"); | 46 TRACE_EVENT0("omnibox", "HistoryQuickProvider::Start"); |
47 matches_.clear(); | 47 matches_.clear(); |
48 if (disabled_ || input.from_omnibox_focus()) | 48 if (disabled_ || input.from_omnibox_focus()) |
49 return; | 49 return; |
50 | 50 |
51 // Don't bother with INVALID and FORCED_QUERY. | 51 // Don't bother with INVALID. |
52 if ((input.type() == metrics::OmniboxInputType::INVALID) || | 52 if ((input.type() == metrics::OmniboxInputType::INVALID)) |
53 (input.type() == metrics::OmniboxInputType::FORCED_QUERY)) | |
54 return; | 53 return; |
55 | 54 |
56 autocomplete_input_ = input; | 55 autocomplete_input_ = input; |
57 | 56 |
58 // TODO(pkasting): We should just block here until this loads. Any time | 57 // TODO(pkasting): We should just block here until this loads. Any time |
59 // someone unloads the history backend, we'll get inconsistent inline | 58 // someone unloads the history backend, we'll get inconsistent inline |
60 // autocomplete behavior here. | 59 // autocomplete behavior here. |
61 if (in_memory_url_index_) { | 60 if (in_memory_url_index_) { |
62 DoAutocomplete(); | 61 DoAutocomplete(); |
63 } | 62 } |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 match.description = info.title(); | 247 match.description = info.title(); |
249 match.description_class = SpansFromTermMatch( | 248 match.description_class = SpansFromTermMatch( |
250 history_match.title_matches, match.description.length(), false); | 249 history_match.title_matches, match.description.length(), false); |
251 | 250 |
252 match.RecordAdditionalInfo("typed count", info.typed_count()); | 251 match.RecordAdditionalInfo("typed count", info.typed_count()); |
253 match.RecordAdditionalInfo("visit count", info.visit_count()); | 252 match.RecordAdditionalInfo("visit count", info.visit_count()); |
254 match.RecordAdditionalInfo("last visit", info.last_visit()); | 253 match.RecordAdditionalInfo("last visit", info.last_visit()); |
255 | 254 |
256 return match; | 255 return match; |
257 } | 256 } |
OLD | NEW |