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

Side by Side Diff: chrome/browser/autocomplete/shortcuts_provider.cc

Issue 773103004: Remove NOTIFICATION_HISTORY_URLS_DELETED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to tip Created 5 years, 11 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/shortcuts_provider.h" 5 #include "chrome/browser/autocomplete/shortcuts_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/i18n/break_iterator.h" 12 #include "base/i18n/break_iterator.h"
13 #include "base/i18n/case_conversion.h" 13 #include "base/i18n/case_conversion.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/metrics/histogram.h" 15 #include "base/metrics/histogram.h"
16 #include "base/prefs/pref_service.h" 16 #include "base/prefs/pref_service.h"
17 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
18 #include "base/strings/string_util.h" 18 #include "base/strings/string_util.h"
19 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
20 #include "base/time/time.h" 20 #include "base/time/time.h"
21 #include "chrome/browser/autocomplete/history_provider.h" 21 #include "chrome/browser/autocomplete/history_provider.h"
22 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" 22 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h"
23 #include "chrome/browser/history/history_notifications.h"
24 #include "chrome/browser/history/history_service.h" 23 #include "chrome/browser/history/history_service.h"
25 #include "chrome/browser/history/history_service_factory.h" 24 #include "chrome/browser/history/history_service_factory.h"
26 #include "chrome/browser/profiles/profile.h" 25 #include "chrome/browser/profiles/profile.h"
27 #include "chrome/browser/search_engines/template_url_service_factory.h" 26 #include "chrome/browser/search_engines/template_url_service_factory.h"
28 #include "chrome/common/pref_names.h" 27 #include "chrome/common/pref_names.h"
29 #include "chrome/common/url_constants.h" 28 #include "chrome/common/url_constants.h"
30 #include "components/metrics/proto/omnibox_input_type.pb.h" 29 #include "components/metrics/proto/omnibox_input_type.pb.h"
31 #include "components/omnibox/autocomplete_input.h" 30 #include "components/omnibox/autocomplete_input.h"
32 #include "components/omnibox/autocomplete_match.h" 31 #include "components/omnibox/autocomplete_match.h"
33 #include "components/omnibox/autocomplete_result.h" 32 #include "components/omnibox/autocomplete_result.h"
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 // (1.0 / each 5 additional hits), up to a maximum of 5x as long. 400 // (1.0 / each 5 additional hits), up to a maximum of 5x as long.
402 const double kMaxDecaySpeedDivisor = 5.0; 401 const double kMaxDecaySpeedDivisor = 5.0;
403 const double kNumUsesPerDecaySpeedDivisorIncrement = 5.0; 402 const double kNumUsesPerDecaySpeedDivisorIncrement = 5.0;
404 double decay_divisor = std::min(kMaxDecaySpeedDivisor, 403 double decay_divisor = std::min(kMaxDecaySpeedDivisor,
405 (shortcut.number_of_hits + kNumUsesPerDecaySpeedDivisorIncrement - 1) / 404 (shortcut.number_of_hits + kNumUsesPerDecaySpeedDivisorIncrement - 1) /
406 kNumUsesPerDecaySpeedDivisorIncrement); 405 kNumUsesPerDecaySpeedDivisorIncrement);
407 406
408 return static_cast<int>((base_score / exp(decay_exponent / decay_divisor)) + 407 return static_cast<int>((base_score / exp(decay_exponent / decay_divisor)) +
409 0.5); 408 0.5);
410 } 409 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/shortcuts_backend_factory.cc ('k') | chrome/browser/chrome_notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698