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

Side by Side Diff: components/language_usage_metrics/language_usage_metrics.cc

Issue 2373523003: Clean up sparse_histogram.h header (Closed)
Patch Set: Rebase update on Oct 18 Created 4 years, 2 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
« no previous file with comments | « components/infobars/core/infobar_container.cc ('k') | components/nacl/browser/bad_message.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/language_usage_metrics/language_usage_metrics.h" 5 #include "components/language_usage_metrics/language_usage_metrics.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/metrics/sparse_histogram.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/strings/string_tokenizer.h" 10 #include "base/strings/string_tokenizer.h"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 12
13 namespace { 13 namespace {
14 void RecordAcceptLanguage(int language_code) { 14 void RecordAcceptLanguage(int language_code) {
15 UMA_HISTOGRAM_SPARSE_SLOWLY("LanguageUsage.AcceptLanguage", 15 UMA_HISTOGRAM_SPARSE_SLOWLY("LanguageUsage.AcceptLanguage",
16 language_code); 16 language_code);
17 } 17 }
18 } // namespace 18 } // namespace
19 19
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 languages->clear(); 65 languages->clear();
66 base::StringTokenizer locales(accept_languages, ","); 66 base::StringTokenizer locales(accept_languages, ",");
67 while (locales.GetNext()) { 67 while (locales.GetNext()) {
68 const int language_code = ToLanguageCode(locales.token()); 68 const int language_code = ToLanguageCode(locales.token());
69 if (language_code != 0) 69 if (language_code != 0)
70 languages->insert(language_code); 70 languages->insert(language_code);
71 } 71 }
72 } 72 }
73 73
74 } // namespace language_usage_metrics 74 } // namespace language_usage_metrics
OLDNEW
« no previous file with comments | « components/infobars/core/infobar_container.cc ('k') | components/nacl/browser/bad_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698