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

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

Issue 2759313002: Make UKM Observers ignore ChromeOS SigninProfile (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 #if BUILDFLAG(ENABLE_EXTENSIONS) 100 #if BUILDFLAG(ENABLE_EXTENSIONS)
101 #include "chrome/browser/metrics/extensions_metrics_provider.h" 101 #include "chrome/browser/metrics/extensions_metrics_provider.h"
102 #endif 102 #endif
103 103
104 #if BUILDFLAG(ENABLE_PLUGINS) 104 #if BUILDFLAG(ENABLE_PLUGINS)
105 #include "chrome/browser/metrics/plugin_metrics_provider.h" 105 #include "chrome/browser/metrics/plugin_metrics_provider.h"
106 #endif 106 #endif
107 107
108 #if defined(OS_CHROMEOS) 108 #if defined(OS_CHROMEOS)
109 #include "chrome/browser/chromeos/profiles/profile_helper.h"
109 #include "chrome/browser/metrics/chromeos_metrics_provider.h" 110 #include "chrome/browser/metrics/chromeos_metrics_provider.h"
110 #include "chrome/browser/signin/signin_status_metrics_provider_chromeos.h" 111 #include "chrome/browser/signin/signin_status_metrics_provider_chromeos.h"
111 #endif 112 #endif
112 113
113 #if defined(OS_WIN) 114 #if defined(OS_WIN)
114 #include <windows.h> 115 #include <windows.h>
115 116
116 #include "chrome/browser/metrics/antivirus_metrics_provider_win.h" 117 #include "chrome/browser/metrics/antivirus_metrics_provider_win.h"
117 #include "chrome/browser/metrics/google_update_metrics_provider_win.h" 118 #include "chrome/browser/metrics/google_update_metrics_provider_win.h"
118 #include "chrome/common/metrics_constants_util_win.h" 119 #include "chrome/common/metrics_constants_util_win.h"
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 // Observe history deletions for all profiles. 898 // Observe history deletions for all profiles.
898 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_ADDED, 899 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_ADDED,
899 content::NotificationService::AllBrowserContextsAndSources()); 900 content::NotificationService::AllBrowserContextsAndSources());
900 for (Profile* profile : 901 for (Profile* profile :
901 g_browser_process->profile_manager()->GetLoadedProfiles()) { 902 g_browser_process->profile_manager()->GetLoadedProfiles()) {
902 RegisterForProfileEvents(profile); 903 RegisterForProfileEvents(profile);
903 } 904 }
904 } 905 }
905 906
906 void ChromeMetricsServiceClient::RegisterForProfileEvents(Profile* profile) { 907 void ChromeMetricsServiceClient::RegisterForProfileEvents(Profile* profile) {
908 #if defined(OS_CHROMEOS)
909 // Ignore the signin profile for sync disables / history deletion.
910 if (chromeos::ProfileHelper::IsSigninProfile(profile))
911 return;
912 #endif
907 history::HistoryService* history_service = 913 history::HistoryService* history_service =
908 HistoryServiceFactory::GetForProfile(profile, 914 HistoryServiceFactory::GetForProfile(profile,
909 ServiceAccessType::IMPLICIT_ACCESS); 915 ServiceAccessType::IMPLICIT_ACCESS);
910 ObserveServiceForDeletions(history_service); 916 ObserveServiceForDeletions(history_service);
911 browser_sync::ProfileSyncService* sync = 917 browser_sync::ProfileSyncService* sync =
912 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); 918 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile);
913 if (sync) 919 if (sync)
914 ObserveServiceForSyncDisables(static_cast<syncer::SyncService*>(sync)); 920 ObserveServiceForSyncDisables(static_cast<syncer::SyncService*>(sync));
915 } 921 }
916 922
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 ukm_service_->Purge(); 967 ukm_service_->Purge();
962 ukm_service_->ResetClientId(); 968 ukm_service_->ResetClientId();
963 } 969 }
964 // Signal service manager to enable/disable UKM based on new state. 970 // Signal service manager to enable/disable UKM based on new state.
965 UpdateRunningServices(); 971 UpdateRunningServices();
966 } 972 }
967 973
968 bool ChromeMetricsServiceClient::IsHistorySyncEnabledOnAllProfiles() { 974 bool ChromeMetricsServiceClient::IsHistorySyncEnabledOnAllProfiles() {
969 return SyncDisableObserver::IsHistorySyncEnabledOnAllProfiles(); 975 return SyncDisableObserver::IsHistorySyncEnabledOnAllProfiles();
970 } 976 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698