| 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" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 FROM_HERE, | 29 FROM_HERE, |
| 30 base::Bind(&GoogleUpdateSettings::StoreMetricsClientInfo, client_info)); | 30 base::Bind(&GoogleUpdateSettings::StoreMetricsClientInfo, client_info)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 } // namespace | 33 } // namespace |
| 34 | 34 |
| 35 ChromeMetricsServicesManagerClient::ChromeMetricsServicesManagerClient( | 35 ChromeMetricsServicesManagerClient::ChromeMetricsServicesManagerClient( |
| 36 PrefService* local_state) | 36 PrefService* local_state) |
| 37 : local_state_(local_state) { | 37 : local_state_(local_state) { |
| 38 DCHECK(local_state); | 38 DCHECK(local_state); |
| 39 |
| 40 SetupMetricsStateForChromeOS(); |
| 39 } | 41 } |
| 40 | 42 |
| 41 ChromeMetricsServicesManagerClient::~ChromeMetricsServicesManagerClient() {} | 43 ChromeMetricsServicesManagerClient::~ChromeMetricsServicesManagerClient() {} |
| 42 | 44 |
| 43 scoped_ptr<rappor::RapporService> | 45 scoped_ptr<rappor::RapporService> |
| 44 ChromeMetricsServicesManagerClient::CreateRapporService() { | 46 ChromeMetricsServicesManagerClient::CreateRapporService() { |
| 45 DCHECK(thread_checker_.CalledOnValidThread()); | 47 DCHECK(thread_checker_.CalledOnValidThread()); |
| 46 return make_scoped_ptr(new rappor::RapporService( | 48 return make_scoped_ptr(new rappor::RapporService( |
| 47 local_state_, base::Bind(&chrome::IsOffTheRecordSessionActive))); | 49 local_state_, base::Bind(&chrome::IsOffTheRecordSessionActive))); |
| 48 } | 50 } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 if (!metrics_state_manager_) { | 105 if (!metrics_state_manager_) { |
| 104 metrics_state_manager_ = metrics::MetricsStateManager::Create( | 106 metrics_state_manager_ = metrics::MetricsStateManager::Create( |
| 105 local_state_, | 107 local_state_, |
| 106 base::Bind( | 108 base::Bind( |
| 107 &ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled), | 109 &ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled), |
| 108 base::Bind(&PostStoreMetricsClientInfo), | 110 base::Bind(&PostStoreMetricsClientInfo), |
| 109 base::Bind(&GoogleUpdateSettings::LoadMetricsClientInfo)); | 111 base::Bind(&GoogleUpdateSettings::LoadMetricsClientInfo)); |
| 110 } | 112 } |
| 111 return metrics_state_manager_.get(); | 113 return metrics_state_manager_.get(); |
| 112 } | 114 } |
| OLD | NEW |