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

Unified Diff: chrome/browser/language_usage_metrics.h

Issue 131203002: Move LanguageUsageMetrics and TranslateBrowserMetrics to components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/language_usage_metrics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/language_usage_metrics.h
diff --git a/chrome/browser/language_usage_metrics.h b/chrome/browser/language_usage_metrics.h
deleted file mode 100644
index 15a6868e59a6686246a0e34a974f6f8a4ac902a2..0000000000000000000000000000000000000000
--- a/chrome/browser/language_usage_metrics.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_LANGUAGE_USAGE_METRICS_H_
-#define CHROME_BROWSER_LANGUAGE_USAGE_METRICS_H_
-
-#include <set>
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/gtest_prod_util.h"
-
-// Methods to record language usage as UMA histograms.
-class LanguageUsageMetrics {
- public:
- // Records accept languages as a UMA histogram. |accept_languages| is a
- // case-insensitive comma-separated list of languages/locales of either xx,
- // xx-YY, or xx_YY format where xx is iso-639 language code and YY is iso-3166
- // country code. Country code is ignored. That is, xx and XX-YY are considered
- // identical and recorded once.
- static void RecordAcceptLanguages(const std::string& accept_languages);
-
- // Records the application language as a UMA histogram. |application_locale|
- // is a case-insensitive locale string of either xx, xx-YY, or xx_YY format.
- // Only the language part (xx in the example) is considered.
- static void RecordApplicationLanguage(const std::string& application_locale);
-
- // Parses |locale| and returns the language code. Returns 0 in case of errors.
- // The language code is calculated from two alphabets. For example, if
- // |locale| is 'en' which represents 'English', the codes of 'e' and 'n' are
- // 101 and 110 respectively, and the language code will be 101 * 256 + 100 =
- // 25966.
- // |locale| should consist of only lower-case letters. This function doesn't
- // check whether |locale| is valid locale or not strictly.
- static int ToLanguageCode(const std::string &locale);
-
- private:
- DISALLOW_IMPLICIT_CONSTRUCTORS(LanguageUsageMetrics);
-
- // Parses |accept_languages| and returns a set of language codes in
- // |languages|.
- static void ParseAcceptLanguages(const std::string& accept_languages,
- std::set<int>* languages);
-
- FRIEND_TEST_ALL_PREFIXES(LanguageUsageMetricsTest, ParseAcceptLanguages);
-};
-
-#endif // CHROME_BROWSER_LANGUAGE_USAGE_METRICS_H_
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/language_usage_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698