 Chromium Code Reviews
 Chromium Code Reviews Issue 131203002:
  Move LanguageUsageMetrics and TranslateBrowserMetrics to components  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 131203002:
  Move LanguageUsageMetrics and TranslateBrowserMetrics to components  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| OLD | NEW | 
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_LANGUAGE_USAGE_METRICS_H_ | 5 #ifndef COMPONENTS_LANGUAGE_USAGE_METRICS_LANGUAGE_USAGE_METRICS_H_ | 
| 6 #define CHROME_BROWSER_LANGUAGE_USAGE_METRICS_H_ | 6 #define COMPONENTS_LANGUAGE_USAGE_METRICS_LANGUAGE_USAGE_METRICS_H_ | 
| 7 | 7 | 
| 8 #include <set> | 8 #include <set> | 
| 9 #include <string> | 9 #include <string> | 
| 10 | 10 | 
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" | 
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" | 
| 13 | 13 | 
| 14 // Methods to record language usage as UMA histograms. | 14 // Methods to record language usage as UMA histograms. | 
| 
blundell
2014/01/09 09:53:08
This should be in the language_usage_metrics names
 | |
| 15 class LanguageUsageMetrics { | 15 class LanguageUsageMetrics { | 
| 
Jói
2014/01/09 10:44:14
Code in a component located in //components/xyz sh
 
droger
2014/01/09 11:52:28
Done.
 | |
| 16 public: | 16 public: | 
| 17 // Records accept languages as a UMA histogram. |accept_languages| is a | 17 // Records accept languages as a UMA histogram. |accept_languages| is a | 
| 18 // case-insensitive comma-separated list of languages/locales of either xx, | 18 // case-insensitive comma-separated list of languages/locales of either xx, | 
| 19 // xx-YY, or xx_YY format where xx is iso-639 language code and YY is iso-3166 | 19 // xx-YY, or xx_YY format where xx is iso-639 language code and YY is iso-3166 | 
| 20 // country code. Country code is ignored. That is, xx and XX-YY are considered | 20 // country code. Country code is ignored. That is, xx and XX-YY are considered | 
| 21 // identical and recorded once. | 21 // identical and recorded once. | 
| 22 static void RecordAcceptLanguages(const std::string& accept_languages); | 22 static void RecordAcceptLanguages(const std::string& accept_languages); | 
| 23 | 23 | 
| 24 // Records the application language as a UMA histogram. |application_locale| | 24 // Records the application language as a UMA histogram. |application_locale| | 
| 25 // is a case-insensitive locale string of either xx, xx-YY, or xx_YY format. | 25 // is a case-insensitive locale string of either xx, xx-YY, or xx_YY format. | 
| (...skipping 13 matching lines...) Expand all Loading... | |
| 39 DISALLOW_IMPLICIT_CONSTRUCTORS(LanguageUsageMetrics); | 39 DISALLOW_IMPLICIT_CONSTRUCTORS(LanguageUsageMetrics); | 
| 40 | 40 | 
| 41 // Parses |accept_languages| and returns a set of language codes in | 41 // Parses |accept_languages| and returns a set of language codes in | 
| 42 // |languages|. | 42 // |languages|. | 
| 43 static void ParseAcceptLanguages(const std::string& accept_languages, | 43 static void ParseAcceptLanguages(const std::string& accept_languages, | 
| 44 std::set<int>* languages); | 44 std::set<int>* languages); | 
| 45 | 45 | 
| 46 FRIEND_TEST_ALL_PREFIXES(LanguageUsageMetricsTest, ParseAcceptLanguages); | 46 FRIEND_TEST_ALL_PREFIXES(LanguageUsageMetricsTest, ParseAcceptLanguages); | 
| 47 }; | 47 }; | 
| 48 | 48 | 
| 49 #endif // CHROME_BROWSER_LANGUAGE_USAGE_METRICS_H_ | 49 #endif // COMPONENTS_LANGUAGE_USAGE_METRICS_LANGUAGE_USAGE_METRICS_H_ | 
| OLD | NEW |