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

Side by Side Diff: components/omnibox/browser/shortcuts_provider.cc

Issue 1551433002: Switch to standard integer types in components/, part 3 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 4 years, 12 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 "components/omnibox/browser/shortcuts_provider.h" 5 #include "components/omnibox/browser/shortcuts_provider.h"
6 6
7 #include <stddef.h>
8
7 #include <algorithm> 9 #include <algorithm>
8 #include <cmath> 10 #include <cmath>
9 #include <map> 11 #include <map>
10 #include <vector> 12 #include <vector>
11 13
12 #include "base/i18n/break_iterator.h" 14 #include "base/i18n/break_iterator.h"
13 #include "base/i18n/case_conversion.h" 15 #include "base/i18n/case_conversion.h"
14 #include "base/logging.h" 16 #include "base/logging.h"
15 #include "base/metrics/histogram.h" 17 #include "base/metrics/histogram.h"
16 #include "base/prefs/pref_service.h" 18 #include "base/prefs/pref_service.h"
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 const double kMaxDecaySpeedDivisor = 5.0; 414 const double kMaxDecaySpeedDivisor = 5.0;
413 const double kNumUsesPerDecaySpeedDivisorIncrement = 5.0; 415 const double kNumUsesPerDecaySpeedDivisorIncrement = 5.0;
414 double decay_divisor = std::min( 416 double decay_divisor = std::min(
415 kMaxDecaySpeedDivisor, 417 kMaxDecaySpeedDivisor,
416 (shortcut.number_of_hits + kNumUsesPerDecaySpeedDivisorIncrement - 1) / 418 (shortcut.number_of_hits + kNumUsesPerDecaySpeedDivisorIncrement - 1) /
417 kNumUsesPerDecaySpeedDivisorIncrement); 419 kNumUsesPerDecaySpeedDivisorIncrement);
418 420
419 return static_cast<int>((base_score / exp(decay_exponent / decay_divisor)) + 421 return static_cast<int>((base_score / exp(decay_exponent / decay_divisor)) +
420 0.5); 422 0.5);
421 } 423 }
OLDNEW
« no previous file with comments | « components/omnibox/browser/shortcuts_database_unittest.cc ('k') | components/omnibox/browser/suggestion_answer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698