| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 44 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
| 45 #include "ios/web/public/web_thread.h" | 45 #include "ios/web/public/web_thread.h" |
| 46 #include "net/base/network_change_notifier.h" | 46 #include "net/base/network_change_notifier.h" |
| 47 #include "net/http/http_network_layer.h" | 47 #include "net/http/http_network_layer.h" |
| 48 #include "net/http/http_stream_factory.h" | 48 #include "net/http/http_stream_factory.h" |
| 49 #include "net/url_request/url_request.h" | 49 #include "net/url_request/url_request.h" |
| 50 #include "ui/base/l10n/l10n_util_mac.h" | 50 #include "ui/base/l10n/l10n_util_mac.h" |
| 51 #include "ui/base/resource/resource_bundle.h" | 51 #include "ui/base/resource/resource_bundle.h" |
| 52 | 52 |
| 53 #if defined(ENABLE_RLZ) | 53 #if defined(ENABLE_RLZ) |
| 54 #include "components/rlz/rlz_tracker.h" // nogncheck | 54 #include "components/rlz/rlz_tracker.h" |
| 55 #include "ios/chrome/browser/rlz/rlz_tracker_delegate_impl.h" // nogncheck | 55 #include "ios/chrome/browser/rlz/rlz_tracker_delegate_impl.h" |
| 56 #endif | 56 #endif |
| 57 | 57 |
| 58 IOSChromeMainParts::IOSChromeMainParts( | 58 IOSChromeMainParts::IOSChromeMainParts( |
| 59 const base::CommandLine& parsed_command_line) | 59 const base::CommandLine& parsed_command_line) |
| 60 : parsed_command_line_(parsed_command_line), local_state_(nullptr) { | 60 : parsed_command_line_(parsed_command_line), local_state_(nullptr) { |
| 61 // Chrome disallows cookies by default. All code paths that want to use | 61 // Chrome disallows cookies by default. All code paths that want to use |
| 62 // cookies need to go through one of Chrome's URLRequestContexts which have | 62 // cookies need to go through one of Chrome's URLRequestContexts which have |
| 63 // a ChromeNetworkDelegate attached that selectively allows cookies again. | 63 // a ChromeNetworkDelegate attached that selectively allows cookies again. |
| 64 net::URLRequest::SetDefaultCookiePolicyToBlock(); | 64 net::URLRequest::SetDefaultCookiePolicyToBlock(); |
| 65 } | 65 } |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 void IOSChromeMainParts::StartMetricsRecording() { | 248 void IOSChromeMainParts::StartMetricsRecording() { |
| 249 bool wifiOnly = local_state_->GetBoolean(prefs::kMetricsReportingWifiOnly); | 249 bool wifiOnly = local_state_->GetBoolean(prefs::kMetricsReportingWifiOnly); |
| 250 bool isConnectionCellular = net::NetworkChangeNotifier::IsConnectionCellular( | 250 bool isConnectionCellular = net::NetworkChangeNotifier::IsConnectionCellular( |
| 251 net::NetworkChangeNotifier::GetConnectionType()); | 251 net::NetworkChangeNotifier::GetConnectionType()); |
| 252 bool mayUpload = !wifiOnly || !isConnectionCellular; | 252 bool mayUpload = !wifiOnly || !isConnectionCellular; |
| 253 | 253 |
| 254 application_context_->GetMetricsServicesManager()->UpdateUploadPermissions( | 254 application_context_->GetMetricsServicesManager()->UpdateUploadPermissions( |
| 255 mayUpload); | 255 mayUpload); |
| 256 } | 256 } |
| OLD | NEW |