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