Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: components/omnibox/scored_history_match.cc

Issue 1181113005: Componentize HistoryURLProvider/ScoredHistoryMatch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prepare_history_url_provider_for_c14n
Patch Set: Rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « components/omnibox/scored_history_match.h ('k') | components/omnibox/scored_history_match_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698