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/common/translate_metrics.h" | 5 #include "components/translate/core/common/translate_metrics.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "url/url_constants.h" | 9 #include "url/url_constants.h" |
10 | 10 |
11 namespace translate { | 11 namespace translate { |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 // Constant string values to indicate UMA names. All entries should have | 15 // Constant string values to indicate UMA names. All entries should have |
16 // a corresponding index in MetricsNameIndex and an entry in |kMetricsEntries|. | 16 // a corresponding index in MetricsNameIndex and an entry in |kMetricsEntries|. |
17 const char kRenderer4LanguageDetection[] = "Renderer4.LanguageDetection"; | 17 const char kRenderer4LanguageDetection[] = "Renderer4.LanguageDetection"; |
18 const char kTranslateContentLanguage[] = "Translate.ContentLanguage"; | 18 const char kTranslateContentLanguage[] = "Translate.ContentLanguage"; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 const char* GetMetricsName(MetricsNameIndex index) { | 122 const char* GetMetricsName(MetricsNameIndex index) { |
123 for (size_t i = 0; i < arraysize(kMetricsEntries); ++i) { | 123 for (size_t i = 0; i < arraysize(kMetricsEntries); ++i) { |
124 if (kMetricsEntries[i].index == index) | 124 if (kMetricsEntries[i].index == index) |
125 return kMetricsEntries[i].name; | 125 return kMetricsEntries[i].name; |
126 } | 126 } |
127 NOTREACHED(); | 127 NOTREACHED(); |
128 return NULL; | 128 return NULL; |
129 } | 129 } |
130 | 130 |
131 } // namespace translate | 131 } // namespace translate |
OLD | NEW |