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

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

Issue 16746002: Use a direct include of strings headers in chrome/auto*/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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/string_util.h"
18 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.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.h" 20 #include "base/time.h"
21 #include "chrome/browser/autocomplete/autocomplete_input.h" 21 #include "chrome/browser/autocomplete/autocomplete_input.h"
22 #include "chrome/browser/autocomplete/autocomplete_provider_listener.h" 22 #include "chrome/browser/autocomplete/autocomplete_provider_listener.h"
23 #include "chrome/browser/autocomplete/autocomplete_result.h" 23 #include "chrome/browser/autocomplete/autocomplete_result.h"
24 #include "chrome/browser/history/history_notifications.h" 24 #include "chrome/browser/history/history_notifications.h"
25 #include "chrome/browser/history/history_service.h" 25 #include "chrome/browser/history/history_service.h"
26 #include "chrome/browser/history/history_service_factory.h" 26 #include "chrome/browser/history/history_service_factory.h"
27 #include "chrome/browser/history/shortcuts_backend_factory.h" 27 #include "chrome/browser/history/shortcuts_backend_factory.h"
28 #include "chrome/browser/profiles/profile.h" 28 #include "chrome/browser/profiles/profile.h"
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 // (1.0 / each 5 additional hits), up to a maximum of 5x as long. 347 // (1.0 / each 5 additional hits), up to a maximum of 5x as long.
348 const double kMaxDecaySpeedDivisor = 5.0; 348 const double kMaxDecaySpeedDivisor = 5.0;
349 const double kNumUsesPerDecaySpeedDivisorIncrement = 5.0; 349 const double kNumUsesPerDecaySpeedDivisorIncrement = 5.0;
350 double decay_divisor = std::min(kMaxDecaySpeedDivisor, 350 double decay_divisor = std::min(kMaxDecaySpeedDivisor,
351 (shortcut.number_of_hits + kNumUsesPerDecaySpeedDivisorIncrement - 1) / 351 (shortcut.number_of_hits + kNumUsesPerDecaySpeedDivisorIncrement - 1) /
352 kNumUsesPerDecaySpeedDivisorIncrement); 352 kNumUsesPerDecaySpeedDivisorIncrement);
353 353
354 return static_cast<int>((base_score / exp(decay_exponent / decay_divisor)) + 354 return static_cast<int>((base_score / exp(decay_exponent / decay_divisor)) +
355 0.5); 355 0.5);
356 } 356 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/search_provider_unittest.cc ('k') | chrome/browser/autocomplete/shortcuts_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698