| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ios/chrome/browser/ios_chrome_main_parts.h" | 5 #include "ios/chrome/browser/ios_chrome_main_parts.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 local_state_ = application_context_->GetLocalState(); | 100 local_state_ = application_context_->GetLocalState(); |
| 101 DCHECK(local_state_); | 101 DCHECK(local_state_); |
| 102 | 102 |
| 103 flags_ui::PrefServiceFlagsStorage flags_storage( | 103 flags_ui::PrefServiceFlagsStorage flags_storage( |
| 104 application_context_->GetLocalState()); | 104 application_context_->GetLocalState()); |
| 105 ConvertFlagsToSwitches(&flags_storage, | 105 ConvertFlagsToSwitches(&flags_storage, |
| 106 base::CommandLine::ForCurrentProcess()); | 106 base::CommandLine::ForCurrentProcess()); |
| 107 | 107 |
| 108 // Initialize tracking synchronizer system. | 108 // Initialize tracking synchronizer system. |
| 109 tracking_synchronizer_ = new metrics::TrackingSynchronizer( | 109 tracking_synchronizer_ = new metrics::TrackingSynchronizer( |
| 110 base::WrapUnique(new base::DefaultTickClock()), | 110 base::MakeUnique<base::DefaultTickClock>(), |
| 111 base::Bind(&metrics::IOSTrackingSynchronizerDelegate::Create)); | 111 base::Bind(&metrics::IOSTrackingSynchronizerDelegate::Create)); |
| 112 | 112 |
| 113 // Now the command line has been mutated based on about:flags, we can setup | 113 // Now the command line has been mutated based on about:flags, we can setup |
| 114 // metrics and initialize field trials that are needed by IOSChromeIOThread's | 114 // metrics and initialize field trials that are needed by IOSChromeIOThread's |
| 115 // initialization which happens in ApplicationContext:PreCreateThreads. | 115 // initialization which happens in ApplicationContext:PreCreateThreads. |
| 116 SetUpMetricsAndFieldTrials(); | 116 SetUpMetricsAndFieldTrials(); |
| 117 | 117 |
| 118 // Initialize FieldTrialSynchronizer system. | 118 // Initialize FieldTrialSynchronizer system. |
| 119 field_trial_synchronizer_.reset(new ios::FieldTrialSynchronizer); | 119 field_trial_synchronizer_.reset(new ios::FieldTrialSynchronizer); |
| 120 | 120 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 256 |
| 257 void IOSChromeMainParts::StartMetricsRecording() { | 257 void IOSChromeMainParts::StartMetricsRecording() { |
| 258 bool wifiOnly = local_state_->GetBoolean(prefs::kMetricsReportingWifiOnly); | 258 bool wifiOnly = local_state_->GetBoolean(prefs::kMetricsReportingWifiOnly); |
| 259 bool isConnectionCellular = net::NetworkChangeNotifier::IsConnectionCellular( | 259 bool isConnectionCellular = net::NetworkChangeNotifier::IsConnectionCellular( |
| 260 net::NetworkChangeNotifier::GetConnectionType()); | 260 net::NetworkChangeNotifier::GetConnectionType()); |
| 261 bool mayUpload = !wifiOnly || !isConnectionCellular; | 261 bool mayUpload = !wifiOnly || !isConnectionCellular; |
| 262 | 262 |
| 263 application_context_->GetMetricsServicesManager()->UpdateUploadPermissions( | 263 application_context_->GetMetricsServicesManager()->UpdateUploadPermissions( |
| 264 mayUpload); | 264 mayUpload); |
| 265 } | 265 } |
| OLD | NEW |