OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/callback.h" | 7 #include "base/callback.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/browser/autocomplete/autocomplete_match.h" | 11 #include "chrome/browser/autocomplete/autocomplete_match.h" |
12 #include "chrome/browser/bookmarks/bookmark_model.h" | 12 #include "chrome/browser/bookmarks/bookmark_model.h" |
13 #include "chrome/browser/bookmarks/bookmark_utils.h" | 13 #include "chrome/browser/bookmarks/bookmark_utils.h" |
14 #include "chrome/browser/history/query_parser.h" | 14 #include "chrome/browser/history/query_parser.h" |
15 #include "chrome/browser/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
17 #include "googleurl/src/url_util.h" | 17 #include "googleurl/src/url_util.h" |
18 #include "net/base/net_util.h" | 18 #include "net/base/net_util.h" |
19 | 19 |
20 using base::TimeTicks; | 20 using base::TimeTicks; |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 // Number of days to search for full text results. The longer this is, the more | 24 // Number of days to search for full text results. The longer this is, the more |
25 // time it will take. | 25 // time it will take. |
(...skipping 265 matching lines...) Loading... |
291 UMA_HISTOGRAM_TIMES("Omnibox.QueryBookmarksTime", | 291 UMA_HISTOGRAM_TIMES("Omnibox.QueryBookmarksTime", |
292 TimeTicks::Now() - start_time); | 292 TimeTicks::Now() - start_time); |
293 } | 293 } |
294 | 294 |
295 void HistoryContentsProvider::AddBookmarkTitleMatchToResults( | 295 void HistoryContentsProvider::AddBookmarkTitleMatchToResults( |
296 const bookmark_utils::TitleMatch& match) { | 296 const bookmark_utils::TitleMatch& match) { |
297 history::URLResult url_result(match.node->GetURL(), match.match_positions); | 297 history::URLResult url_result(match.node->GetURL(), match.match_positions); |
298 url_result.set_title(match.node->GetTitle()); | 298 url_result.set_title(match.node->GetTitle()); |
299 results_.AppendURLBySwapping(&url_result); | 299 results_.AppendURLBySwapping(&url_result); |
300 } | 300 } |
OLD | NEW |