| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 StartMetricsRecording(); | 144 StartMetricsRecording(); |
| 145 | 145 |
| 146 application_context_->PreMainMessageLoopRun(); | 146 application_context_->PreMainMessageLoopRun(); |
| 147 | 147 |
| 148 // ContentSettingsPattern need to be initialized before creating the | 148 // ContentSettingsPattern need to be initialized before creating the |
| 149 // ChromeBrowserState. | 149 // ChromeBrowserState. |
| 150 ContentSettingsPattern::SetNonWildcardDomainNonPortScheme( | 150 ContentSettingsPattern::SetNonWildcardDomainNonPortScheme( |
| 151 kDummyExtensionScheme); | 151 kDummyExtensionScheme); |
| 152 | 152 |
| 153 // Ensure ClipboadRecentContentIOS is created. | 153 // Ensure ClipboadRecentContentIOS is created. |
| 154 ClipboardRecentContent::SetInstance( | 154 ClipboardRecentContent::SetInstance(CreateClipboardRecentContentIOS()); |
| 155 CreateClipboardRecentContentIOS().release()); | |
| 156 | 155 |
| 157 // Ensure that the browser state is initialized. | 156 // Ensure that the browser state is initialized. |
| 158 EnsureBrowserStateKeyedServiceFactoriesBuilt(); | 157 EnsureBrowserStateKeyedServiceFactoriesBuilt(); |
| 159 ios::ChromeBrowserStateManager* browser_state_manager = | 158 ios::ChromeBrowserStateManager* browser_state_manager = |
| 160 application_context_->GetChromeBrowserStateManager(); | 159 application_context_->GetChromeBrowserStateManager(); |
| 161 ios::ChromeBrowserState* last_used_browser_state = | 160 ios::ChromeBrowserState* last_used_browser_state = |
| 162 browser_state_manager->GetLastUsedBrowserState(); | 161 browser_state_manager->GetLastUsedBrowserState(); |
| 163 | 162 |
| 164 #if BUILDFLAG(ENABLE_RLZ) | 163 #if BUILDFLAG(ENABLE_RLZ) |
| 165 // Init the RLZ library. This just schedules a task on the file thread to be | 164 // Init the RLZ library. This just schedules a task on the file thread to be |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 282 |
| 284 void IOSChromeMainParts::StartMetricsRecording() { | 283 void IOSChromeMainParts::StartMetricsRecording() { |
| 285 bool wifiOnly = local_state_->GetBoolean(prefs::kMetricsReportingWifiOnly); | 284 bool wifiOnly = local_state_->GetBoolean(prefs::kMetricsReportingWifiOnly); |
| 286 bool isConnectionCellular = net::NetworkChangeNotifier::IsConnectionCellular( | 285 bool isConnectionCellular = net::NetworkChangeNotifier::IsConnectionCellular( |
| 287 net::NetworkChangeNotifier::GetConnectionType()); | 286 net::NetworkChangeNotifier::GetConnectionType()); |
| 288 bool mayUpload = !wifiOnly || !isConnectionCellular; | 287 bool mayUpload = !wifiOnly || !isConnectionCellular; |
| 289 | 288 |
| 290 application_context_->GetMetricsServicesManager()->UpdateUploadPermissions( | 289 application_context_->GetMetricsServicesManager()->UpdateUploadPermissions( |
| 291 mayUpload); | 290 mayUpload); |
| 292 } | 291 } |
| OLD | NEW |