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

Side by Side Diff: chrome/common/translate/translate_common_metrics.cc

Issue 18820002: Remove ENABLE_LANGUAGE_DETECTION (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix: mis-rebased Created 7 years, 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/common/translate/translate_common_metrics.h" 5 #include "chrome/common/translate/translate_common_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.h"
9 9
10 namespace { 10 namespace {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 void ReportPageScheme(const std::string& scheme) { 116 void ReportPageScheme(const std::string& scheme) {
117 SchemeType type = SCHEME_OTHERS; 117 SchemeType type = SCHEME_OTHERS;
118 if (scheme == kSchemeHttp) 118 if (scheme == kSchemeHttp)
119 type = SCHEME_HTTP; 119 type = SCHEME_HTTP;
120 else if (scheme == kSchemeHttps) 120 else if (scheme == kSchemeHttps)
121 type = SCHEME_HTTPS; 121 type = SCHEME_HTTPS;
122 UMA_HISTOGRAM_ENUMERATION(kTranslatePageScheme, type, SCHEME_MAX); 122 UMA_HISTOGRAM_ENUMERATION(kTranslatePageScheme, type, SCHEME_MAX);
123 } 123 }
124 124
125 #if defined(ENABLE_LANGUAGE_DETECTION)
126
127 void ReportLanguageDetectionTime(base::TimeTicks begin, base::TimeTicks end) { 125 void ReportLanguageDetectionTime(base::TimeTicks begin, base::TimeTicks end) {
128 UMA_HISTOGRAM_MEDIUM_TIMES(kRenderer4LanguageDetection, end - begin); 126 UMA_HISTOGRAM_MEDIUM_TIMES(kRenderer4LanguageDetection, end - begin);
129 } 127 }
130 128
131 #endif // defined(ENABLE_LANGUAGE_DETECTION)
132
133 void ReportSimilarLanguageMatch(bool match) { 129 void ReportSimilarLanguageMatch(bool match) {
134 UMA_HISTOGRAM_BOOLEAN(kTranslateSimilarLanguageMatch, match); 130 UMA_HISTOGRAM_BOOLEAN(kTranslateSimilarLanguageMatch, match);
135 } 131 }
136 132
137 const char* GetMetricsName(MetricsNameIndex index) { 133 const char* GetMetricsName(MetricsNameIndex index) {
138 for (size_t i = 0; i < arraysize(kMetricsEntries); ++i) { 134 for (size_t i = 0; i < arraysize(kMetricsEntries); ++i) {
139 if (kMetricsEntries[i].index == index) 135 if (kMetricsEntries[i].index == index)
140 return kMetricsEntries[i].name; 136 return kMetricsEntries[i].name;
141 } 137 }
142 NOTREACHED(); 138 NOTREACHED();
143 return NULL; 139 return NULL;
144 } 140 }
145 141
146 } // namespace TranslateCommonMetrics 142 } // namespace TranslateCommonMetrics
OLDNEW
« no previous file with comments | « chrome/common/translate/translate_common_metrics.h ('k') | chrome/common/translate/translate_common_metrics_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698