| OLD | NEW |
| 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/translate/core/browser/translate_browser_metrics.h" | 5 #include "components/translate/core/browser/translate_browser_metrics.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 11 #include "base/metrics/sparse_histogram.h" | 11 #include "base/metrics/sparse_histogram.h" |
| 12 #include "components/language_usage_metrics/language_usage_metrics.h" | 12 #include "components/language_usage_metrics/language_usage_metrics.h" |
| 13 | 13 |
| 14 namespace translate { |
| 15 |
| 14 namespace { | 16 namespace { |
| 15 | 17 |
| 16 // Constant string values to indicate UMA names. All entries should have | 18 // Constant string values to indicate UMA names. All entries should have |
| 17 // a corresponding index in MetricsNameIndex and an entry in |kMetricsEntries|. | 19 // a corresponding index in MetricsNameIndex and an entry in |kMetricsEntries|. |
| 18 const char kTranslateInitiationStatus[] = | 20 const char kTranslateInitiationStatus[] = |
| 19 "Translate.InitiationStatus.v2"; | 21 "Translate.InitiationStatus.v2"; |
| 20 const char kTranslateReportLanguageDetectionError[] = | 22 const char kTranslateReportLanguageDetectionError[] = |
| 21 "Translate.ReportLanguageDetectionError"; | 23 "Translate.ReportLanguageDetectionError"; |
| 22 const char kTranslateLocalesOnDisabledByPrefs[] = | 24 const char kTranslateLocalesOnDisabledByPrefs[] = |
| 23 "Translate.LocalesOnDisabledByPrefs"; | 25 "Translate.LocalesOnDisabledByPrefs"; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 const char* GetMetricsName(MetricsNameIndex index) { | 87 const char* GetMetricsName(MetricsNameIndex index) { |
| 86 for (size_t i = 0; i < arraysize(kMetricsEntries); ++i) { | 88 for (size_t i = 0; i < arraysize(kMetricsEntries); ++i) { |
| 87 if (kMetricsEntries[i].index == index) | 89 if (kMetricsEntries[i].index == index) |
| 88 return kMetricsEntries[i].name; | 90 return kMetricsEntries[i].name; |
| 89 } | 91 } |
| 90 NOTREACHED(); | 92 NOTREACHED(); |
| 91 return NULL; | 93 return NULL; |
| 92 } | 94 } |
| 93 | 95 |
| 94 } // namespace TranslateBrowserMetrics | 96 } // namespace TranslateBrowserMetrics |
| 97 |
| 98 } // namespace translate |
| OLD | NEW |