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

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: put dependency back for installer_util_nacl_win64 fixes compile?! 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 17 matching lines...) Expand all
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"
39 #include "components/metrics/metrics_service.h" 38 #include "components/metrics/metrics_service.h"
40 #include "components/metrics/net/net_metrics_log_uploader.h" 39 #include "components/metrics/net/net_metrics_log_uploader.h"
41 #include "content/public/browser/browser_thread.h" 40 #include "content/public/browser/browser_thread.h"
42 #include "content/public/browser/histogram_fetcher.h" 41 #include "content/public/browser/histogram_fetcher.h"
43 #include "content/public/browser/notification_service.h" 42 #include "content/public/browser/notification_service.h"
44 #include "content/public/browser/render_process_host.h" 43 #include "content/public/browser/render_process_host.h"
45 44
46 #if defined(OS_ANDROID) 45 #if defined(OS_ANDROID)
47 #include "chrome/browser/metrics/android_metrics_provider.h" 46 #include "chrome/browser/metrics/android_metrics_provider.h"
48 #else 47 #else
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 #endif // defined(OS_ANDROID) 157 #endif // defined(OS_ANDROID)
159 158
160 #if defined(ENABLE_PLUGINS) 159 #if defined(ENABLE_PLUGINS)
161 PluginMetricsProvider::RegisterPrefs(registry); 160 PluginMetricsProvider::RegisterPrefs(registry);
162 #endif // defined(ENABLE_PLUGINS) 161 #endif // defined(ENABLE_PLUGINS)
163 } 162 }
164 163
165 void ChromeMetricsServiceClient::SetMetricsClientId( 164 void ChromeMetricsServiceClient::SetMetricsClientId(
166 const std::string& client_id) { 165 const std::string& client_id) {
167 crash_keys::SetCrashClientIdFromGUID(client_id); 166 crash_keys::SetCrashClientIdFromGUID(client_id);
168
169 // Store a backup of the client id in Google Update settings.
170 GoogleUpdateSettings::StoreMetricsClientId(client_id);
171 } 167 }
172 168
173 bool ChromeMetricsServiceClient::IsOffTheRecordSessionActive() { 169 bool ChromeMetricsServiceClient::IsOffTheRecordSessionActive() {
174 return !chrome::IsOffTheRecordSessionActive(); 170 return !chrome::IsOffTheRecordSessionActive();
175 } 171 }
176 172
177 std::string ChromeMetricsServiceClient::GetApplicationLocale() { 173 std::string ChromeMetricsServiceClient::GetApplicationLocale() {
178 return g_browser_process->GetApplicationLocale(); 174 return g_browser_process->GetApplicationLocale();
179 } 175 }
180 176
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 // Capture the histogram samples. 523 // Capture the histogram samples.
528 if (dumps_with_crash != 0) 524 if (dumps_with_crash != 0)
529 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); 525 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash);
530 if (dumps_with_no_crash != 0) 526 if (dumps_with_no_crash != 0)
531 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); 527 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash);
532 int total_dumps = dumps_with_crash + dumps_with_no_crash; 528 int total_dumps = dumps_with_crash + dumps_with_no_crash;
533 if (total_dumps != 0) 529 if (total_dumps != 0)
534 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); 530 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps);
535 } 531 }
536 #endif // defined(OS_WIN) 532 #endif // defined(OS_WIN)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698