OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_contents_provider.h" | 5 #include "chrome/browser/autocomplete/history_contents_provider.h" |
6 | 6 |
7 #include "base/histogram.h" | 7 #include "base/histogram.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "chrome/browser/history/query_parser.h" | 9 #include "chrome/browser/history/query_parser.h" |
10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
11 #include "net/base/net_util.h" | 11 #include "net/base/net_util.h" |
12 | 12 |
| 13 using base::TimeTicks; |
| 14 |
13 namespace { | 15 namespace { |
14 | 16 |
15 // Number of days to search for full text results. The longer this is, the more | 17 // Number of days to search for full text results. The longer this is, the more |
16 // time it will take. | 18 // time it will take. |
17 const int kDaysToSearch = 30; | 19 const int kDaysToSearch = 30; |
18 | 20 |
19 // When processing the results from the history query, this structure points to | 21 // When processing the results from the history query, this structure points to |
20 // a single result. It allows the results to be sorted and processed without | 22 // a single result. It allows the results to be sorted and processed without |
21 // modifying the larger and slower results structure. | 23 // modifying the larger and slower results structure. |
22 struct MatchReference { | 24 struct MatchReference { |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 UMA_HISTOGRAM_TIMES(L"Omnibox.QueryBookmarksTime", | 276 UMA_HISTOGRAM_TIMES(L"Omnibox.QueryBookmarksTime", |
275 TimeTicks::Now() - start_time); | 277 TimeTicks::Now() - start_time); |
276 } | 278 } |
277 | 279 |
278 void HistoryContentsProvider::AddBookmarkTitleMatchToResults( | 280 void HistoryContentsProvider::AddBookmarkTitleMatchToResults( |
279 const BookmarkModel::TitleMatch& match) { | 281 const BookmarkModel::TitleMatch& match) { |
280 history::URLResult url_result(match.node->GetURL(), match.match_positions); | 282 history::URLResult url_result(match.node->GetURL(), match.match_positions); |
281 url_result.set_title(match.node->GetTitle()); | 283 url_result.set_title(match.node->GetTitle()); |
282 results_.AppendURLBySwapping(&url_result); | 284 results_.AppendURLBySwapping(&url_result); |
283 } | 285 } |
OLD | NEW |