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 "chrome/browser/metrics/chrome_metrics_service_client.h" | 5 #include "chrome/browser/metrics/chrome_metrics_service_client.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "base/threading/platform_thread.h" | 17 #include "base/threading/platform_thread.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
20 #include "chrome/browser/chrome_notification_types.h" | 20 #include "chrome/browser/chrome_notification_types.h" |
| 21 #include "chrome/browser/google/google_brand.h" |
21 #include "chrome/browser/google/google_util.h" | 22 #include "chrome/browser/google/google_util.h" |
22 #include "chrome/browser/memory_details.h" | 23 #include "chrome/browser/memory_details.h" |
23 #include "chrome/browser/metrics/extensions_metrics_provider.h" | 24 #include "chrome/browser/metrics/extensions_metrics_provider.h" |
24 #include "chrome/browser/metrics/metrics_service.h" | 25 #include "chrome/browser/metrics/metrics_service.h" |
25 #include "chrome/browser/ui/browser_otr_state.h" | 26 #include "chrome/browser/ui/browser_otr_state.h" |
26 #include "chrome/common/chrome_constants.h" | 27 #include "chrome/common/chrome_constants.h" |
27 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
28 #include "chrome/common/chrome_version_info.h" | 29 #include "chrome/common/chrome_version_info.h" |
29 #include "chrome/common/crash_keys.h" | 30 #include "chrome/common/crash_keys.h" |
30 #include "chrome/common/render_messages.h" | 31 #include "chrome/common/render_messages.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 151 |
151 bool ChromeMetricsServiceClient::IsOffTheRecordSessionActive() { | 152 bool ChromeMetricsServiceClient::IsOffTheRecordSessionActive() { |
152 return !chrome::IsOffTheRecordSessionActive(); | 153 return !chrome::IsOffTheRecordSessionActive(); |
153 } | 154 } |
154 | 155 |
155 std::string ChromeMetricsServiceClient::GetApplicationLocale() { | 156 std::string ChromeMetricsServiceClient::GetApplicationLocale() { |
156 return g_browser_process->GetApplicationLocale(); | 157 return g_browser_process->GetApplicationLocale(); |
157 } | 158 } |
158 | 159 |
159 bool ChromeMetricsServiceClient::GetBrand(std::string* brand_code) { | 160 bool ChromeMetricsServiceClient::GetBrand(std::string* brand_code) { |
160 return google_util::GetBrand(brand_code); | 161 return google_brand::GetBrand(brand_code); |
161 } | 162 } |
162 | 163 |
163 metrics::SystemProfileProto::Channel ChromeMetricsServiceClient::GetChannel() { | 164 metrics::SystemProfileProto::Channel ChromeMetricsServiceClient::GetChannel() { |
164 return AsProtobufChannel(chrome::VersionInfo::GetChannel()); | 165 return AsProtobufChannel(chrome::VersionInfo::GetChannel()); |
165 } | 166 } |
166 | 167 |
167 std::string ChromeMetricsServiceClient::GetVersionString() { | 168 std::string ChromeMetricsServiceClient::GetVersionString() { |
168 chrome::VersionInfo version_info; | 169 chrome::VersionInfo version_info; |
169 if (!version_info.is_valid()) { | 170 if (!version_info.is_valid()) { |
170 NOTREACHED(); | 171 NOTREACHED(); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 // Capture the histogram samples. | 405 // Capture the histogram samples. |
405 if (dumps_with_crash != 0) | 406 if (dumps_with_crash != 0) |
406 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); | 407 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); |
407 if (dumps_with_no_crash != 0) | 408 if (dumps_with_no_crash != 0) |
408 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); | 409 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); |
409 int total_dumps = dumps_with_crash + dumps_with_no_crash; | 410 int total_dumps = dumps_with_crash + dumps_with_no_crash; |
410 if (total_dumps != 0) | 411 if (total_dumps != 0) |
411 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); | 412 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); |
412 } | 413 } |
413 #endif // defined(OS_WIN) | 414 #endif // defined(OS_WIN) |
OLD | NEW |