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