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/scored_history_match.h" | 5 #include "components/omnibox/scored_history_match.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/numerics/safe_conversions.h" | 13 #include "base/numerics/safe_conversions.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "base/strings/string_split.h" | 15 #include "base/strings/string_split.h" |
16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
17 #include "base/strings/utf_offset_string_conversions.h" | 17 #include "base/strings/utf_offset_string_conversions.h" |
18 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
19 #include "chrome/browser/autocomplete/history_url_provider.h" | |
20 #include "components/bookmarks/browser/bookmark_utils.h" | 19 #include "components/bookmarks/browser/bookmark_utils.h" |
| 20 #include "components/omnibox/history_url_provider.h" |
21 #include "components/omnibox/omnibox_field_trial.h" | 21 #include "components/omnibox/omnibox_field_trial.h" |
22 #include "components/omnibox/url_prefix.h" | 22 #include "components/omnibox/url_prefix.h" |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 // The number of days of recency scores to precompute. | 26 // The number of days of recency scores to precompute. |
27 const int kDaysToPrecomputeRecencyScoresFor = 366; | 27 const int kDaysToPrecomputeRecencyScoresFor = 366; |
28 | 28 |
29 // The number of raw term score buckets use; raw term scores greater this are | 29 // The number of raw term score buckets use; raw term scores greater this are |
30 // capped at the score of the largest bucket. | 30 // capped at the score of the largest bucket. |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 base::StringToDouble(it->first, &bucket.first); | 690 base::StringToDouble(it->first, &bucket.first); |
691 DCHECK(is_valid_intermediate_score); | 691 DCHECK(is_valid_intermediate_score); |
692 bool is_valid_hqp_score = base::StringToInt(it->second, &bucket.second); | 692 bool is_valid_hqp_score = base::StringToInt(it->second, &bucket.second); |
693 DCHECK(is_valid_hqp_score); | 693 DCHECK(is_valid_hqp_score); |
694 hqp_buckets->push_back(bucket); | 694 hqp_buckets->push_back(bucket); |
695 } | 695 } |
696 return true; | 696 return true; |
697 } | 697 } |
698 return false; | 698 return false; |
699 } | 699 } |
OLD | NEW |