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

Side by Side Diff: chrome/browser/metrics/chrome_metrics_service_client.cc

Issue 372473004: Retrieve client_id from GoogleUpdateSettings when its missing from Local State. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 6 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 | Annotate | Revision Log
OLDNEW
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
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"
41 #include "components/metrics/metrics_service.h" 40 #include "components/metrics/metrics_service.h"
42 #include "components/metrics/net/net_metrics_log_uploader.h" 41 #include "components/metrics/net/net_metrics_log_uploader.h"
43 #include "content/public/browser/browser_thread.h" 42 #include "content/public/browser/browser_thread.h"
44 #include "content/public/browser/histogram_fetcher.h" 43 #include "content/public/browser/histogram_fetcher.h"
45 #include "content/public/browser/notification_service.h" 44 #include "content/public/browser/notification_service.h"
46 #include "content/public/browser/render_process_host.h" 45 #include "content/public/browser/render_process_host.h"
47 46
48 #if defined(OS_ANDROID) 47 #if defined(OS_ANDROID)
49 #include "chrome/browser/metrics/android_metrics_provider.h" 48 #include "chrome/browser/metrics/android_metrics_provider.h"
50 #else 49 #else
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 #endif // defined(OS_ANDROID) 156 #endif // defined(OS_ANDROID)
158 157
159 #if defined(ENABLE_PLUGINS) 158 #if defined(ENABLE_PLUGINS)
160 PluginMetricsProvider::RegisterPrefs(registry); 159 PluginMetricsProvider::RegisterPrefs(registry);
161 #endif // defined(ENABLE_PLUGINS) 160 #endif // defined(ENABLE_PLUGINS)
162 } 161 }
163 162
164 void ChromeMetricsServiceClient::RegisterClientID( 163 void ChromeMetricsServiceClient::RegisterClientID(
165 const std::string& client_id) { 164 const std::string& client_id) {
166 crash_keys::SetClientIDFromGUID(client_id); 165 crash_keys::SetClientIDFromGUID(client_id);
167
168 // Save a backup of the client id in Google Update settings.
169 GoogleUpdateSettings::SaveMetricsID(client_id);
170 } 166 }
171 167
172 bool ChromeMetricsServiceClient::IsOffTheRecordSessionActive() { 168 bool ChromeMetricsServiceClient::IsOffTheRecordSessionActive() {
173 return !chrome::IsOffTheRecordSessionActive(); 169 return !chrome::IsOffTheRecordSessionActive();
174 } 170 }
175 171
176 std::string ChromeMetricsServiceClient::GetApplicationLocale() { 172 std::string ChromeMetricsServiceClient::GetApplicationLocale() {
177 return g_browser_process->GetApplicationLocale(); 173 return g_browser_process->GetApplicationLocale();
178 } 174 }
179 175
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 // Capture the histogram samples. 527 // Capture the histogram samples.
532 if (dumps_with_crash != 0) 528 if (dumps_with_crash != 0)
533 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); 529 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash);
534 if (dumps_with_no_crash != 0) 530 if (dumps_with_no_crash != 0)
535 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); 531 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash);
536 int total_dumps = dumps_with_crash + dumps_with_no_crash; 532 int total_dumps = dumps_with_crash + dumps_with_no_crash;
537 if (total_dumps != 0) 533 if (total_dumps != 0)
538 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); 534 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps);
539 } 535 }
540 #endif // defined(OS_WIN) 536 #endif // defined(OS_WIN)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698