OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_services_manager_client.h" | 5 #include "chrome/browser/metrics/chrome_metrics_services_manager_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/prefs/pref_service.h" | |
10 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 10 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
12 #include "chrome/browser/metrics/chrome_metrics_service_client.h" | 11 #include "chrome/browser/metrics/chrome_metrics_service_client.h" |
13 #include "chrome/browser/metrics/variations/chrome_variations_service_client.h" | 12 #include "chrome/browser/metrics/variations/chrome_variations_service_client.h" |
14 #include "chrome/browser/metrics/variations/ui_string_overrider_factory.h" | 13 #include "chrome/browser/metrics/variations/ui_string_overrider_factory.h" |
15 #include "chrome/browser/ui/browser_otr_state.h" | 14 #include "chrome/browser/ui/browser_otr_state.h" |
16 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
17 #include "chrome/installer/util/google_update_settings.h" | 16 #include "chrome/installer/util/google_update_settings.h" |
18 #include "components/metrics/metrics_state_manager.h" | 17 #include "components/metrics/metrics_state_manager.h" |
| 18 #include "components/prefs/pref_service.h" |
19 #include "components/rappor/rappor_service.h" | 19 #include "components/rappor/rappor_service.h" |
20 #include "components/variations/service/variations_service.h" | 20 #include "components/variations/service/variations_service.h" |
21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 // Posts |GoogleUpdateSettings::StoreMetricsClientInfo| on blocking pool thread | 25 // Posts |GoogleUpdateSettings::StoreMetricsClientInfo| on blocking pool thread |
26 // because it needs access to IO and cannot work from UI thread. | 26 // because it needs access to IO and cannot work from UI thread. |
27 void PostStoreMetricsClientInfo(const metrics::ClientInfo& client_info) { | 27 void PostStoreMetricsClientInfo(const metrics::ClientInfo& client_info) { |
28 content::BrowserThread::GetBlockingPool()->PostTask( | 28 content::BrowserThread::GetBlockingPool()->PostTask( |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 if (!metrics_state_manager_) { | 105 if (!metrics_state_manager_) { |
106 metrics_state_manager_ = metrics::MetricsStateManager::Create( | 106 metrics_state_manager_ = metrics::MetricsStateManager::Create( |
107 local_state_, | 107 local_state_, |
108 base::Bind( | 108 base::Bind( |
109 &ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled), | 109 &ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled), |
110 base::Bind(&PostStoreMetricsClientInfo), | 110 base::Bind(&PostStoreMetricsClientInfo), |
111 base::Bind(&GoogleUpdateSettings::LoadMetricsClientInfo)); | 111 base::Bind(&GoogleUpdateSettings::LoadMetricsClientInfo)); |
112 } | 112 } |
113 return metrics_state_manager_.get(); | 113 return metrics_state_manager_.get(); |
114 } | 114 } |
OLD | NEW |