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" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "chrome/browser/metrics/omnibox_metrics_provider.h" | 28 #include "chrome/browser/metrics/omnibox_metrics_provider.h" |
29 #include "chrome/browser/metrics/profiler_metrics_provider.h" | 29 #include "chrome/browser/metrics/profiler_metrics_provider.h" |
30 #include "chrome/browser/metrics/tracking_synchronizer.h" | 30 #include "chrome/browser/metrics/tracking_synchronizer.h" |
31 #include "chrome/browser/ui/browser_otr_state.h" | 31 #include "chrome/browser/ui/browser_otr_state.h" |
32 #include "chrome/common/chrome_constants.h" | 32 #include "chrome/common/chrome_constants.h" |
33 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
34 #include "chrome/common/chrome_version_info.h" | 34 #include "chrome/common/chrome_version_info.h" |
35 #include "chrome/common/crash_keys.h" | 35 #include "chrome/common/crash_keys.h" |
36 #include "chrome/common/pref_names.h" | 36 #include "chrome/common/pref_names.h" |
37 #include "chrome/common/render_messages.h" | 37 #include "chrome/common/render_messages.h" |
| 38 #include "chrome/installer/util/google_update_settings.h" |
38 #include "components/metrics/metrics_service.h" | 39 #include "components/metrics/metrics_service.h" |
39 #include "components/metrics/net/net_metrics_log_uploader.h" | 40 #include "components/metrics/net/net_metrics_log_uploader.h" |
40 #include "content/public/browser/browser_thread.h" | 41 #include "content/public/browser/browser_thread.h" |
41 #include "content/public/browser/histogram_fetcher.h" | 42 #include "content/public/browser/histogram_fetcher.h" |
42 #include "content/public/browser/notification_service.h" | 43 #include "content/public/browser/notification_service.h" |
43 #include "content/public/browser/render_process_host.h" | 44 #include "content/public/browser/render_process_host.h" |
44 | 45 |
45 #if defined(OS_ANDROID) | 46 #if defined(OS_ANDROID) |
46 #include "chrome/browser/metrics/android_metrics_provider.h" | 47 #include "chrome/browser/metrics/android_metrics_provider.h" |
47 #else | 48 #else |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 155 |
155 #if defined(OS_ANDROID) | 156 #if defined(OS_ANDROID) |
156 AndroidMetricsProvider::RegisterPrefs(registry); | 157 AndroidMetricsProvider::RegisterPrefs(registry); |
157 #endif // defined(OS_ANDROID) | 158 #endif // defined(OS_ANDROID) |
158 | 159 |
159 #if defined(ENABLE_PLUGINS) | 160 #if defined(ENABLE_PLUGINS) |
160 PluginMetricsProvider::RegisterPrefs(registry); | 161 PluginMetricsProvider::RegisterPrefs(registry); |
161 #endif // defined(ENABLE_PLUGINS) | 162 #endif // defined(ENABLE_PLUGINS) |
162 } | 163 } |
163 | 164 |
164 void ChromeMetricsServiceClient::SetClientID(const std::string& client_id) { | 165 void ChromeMetricsServiceClient::SetMetricsClientId( |
165 crash_keys::SetClientID(client_id); | 166 const std::string& client_id) { |
| 167 crash_keys::SetCrashClientIdFromGUID(client_id); |
| 168 |
| 169 // Store a backup of the client id in Google Update settings. |
| 170 GoogleUpdateSettings::StoreMetricsClientId(client_id); |
166 } | 171 } |
167 | 172 |
168 bool ChromeMetricsServiceClient::IsOffTheRecordSessionActive() { | 173 bool ChromeMetricsServiceClient::IsOffTheRecordSessionActive() { |
169 return !chrome::IsOffTheRecordSessionActive(); | 174 return !chrome::IsOffTheRecordSessionActive(); |
170 } | 175 } |
171 | 176 |
172 std::string ChromeMetricsServiceClient::GetApplicationLocale() { | 177 std::string ChromeMetricsServiceClient::GetApplicationLocale() { |
173 return g_browser_process->GetApplicationLocale(); | 178 return g_browser_process->GetApplicationLocale(); |
174 } | 179 } |
175 | 180 |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 // Capture the histogram samples. | 527 // Capture the histogram samples. |
523 if (dumps_with_crash != 0) | 528 if (dumps_with_crash != 0) |
524 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); | 529 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); |
525 if (dumps_with_no_crash != 0) | 530 if (dumps_with_no_crash != 0) |
526 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); | 531 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); |
527 int total_dumps = dumps_with_crash + dumps_with_no_crash; | 532 int total_dumps = dumps_with_crash + dumps_with_no_crash; |
528 if (total_dumps != 0) | 533 if (total_dumps != 0) |
529 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); | 534 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); |
530 } | 535 } |
531 #endif // defined(OS_WIN) | 536 #endif // defined(OS_WIN) |
OLD | NEW |