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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 #include "net/base/network_change_notifier.h" | 50 #include "net/base/network_change_notifier.h" |
51 #include "net/http/http_network_layer.h" | 51 #include "net/http/http_network_layer.h" |
52 #include "net/http/http_stream_factory.h" | 52 #include "net/http/http_stream_factory.h" |
53 #include "net/url_request/url_request.h" | 53 #include "net/url_request/url_request.h" |
54 #include "ui/base/l10n/l10n_util_mac.h" | 54 #include "ui/base/l10n/l10n_util_mac.h" |
55 #include "ui/base/resource/resource_bundle.h" | 55 #include "ui/base/resource/resource_bundle.h" |
56 | 56 |
57 #if defined(ENABLE_RLZ) | 57 #if defined(ENABLE_RLZ) |
58 #include "components/rlz/rlz_tracker.h" // nogncheck | 58 #include "components/rlz/rlz_tracker.h" // nogncheck |
59 #include "ios/chrome/browser/rlz/rlz_tracker_delegate_impl.h" // nogncheck | 59 #include "ios/chrome/browser/rlz/rlz_tracker_delegate_impl.h" // nogncheck |
60 | |
61 #if !defined(__has_feature) || !__has_feature(objc_arc) | |
sdefresne
2016/11/21 12:35:18
This should be out of the #endif corresponding to
stkhapugin
2016/11/21 15:33:13
Done. Thanks for the good catch!
| |
62 #error "This file requires ARC support." | |
63 #endif | |
60 #endif | 64 #endif |
61 | 65 |
62 IOSChromeMainParts::IOSChromeMainParts( | 66 IOSChromeMainParts::IOSChromeMainParts( |
63 const base::CommandLine& parsed_command_line) | 67 const base::CommandLine& parsed_command_line) |
64 : parsed_command_line_(parsed_command_line), local_state_(nullptr) { | 68 : parsed_command_line_(parsed_command_line), local_state_(nullptr) { |
65 // Chrome disallows cookies by default. All code paths that want to use | 69 // Chrome disallows cookies by default. All code paths that want to use |
66 // cookies need to go through one of Chrome's URLRequestContexts which have | 70 // cookies need to go through one of Chrome's URLRequestContexts which have |
67 // a ChromeNetworkDelegate attached that selectively allows cookies again. | 71 // a ChromeNetworkDelegate attached that selectively allows cookies again. |
68 net::URLRequest::SetDefaultCookiePolicyToBlock(); | 72 net::URLRequest::SetDefaultCookiePolicyToBlock(); |
69 } | 73 } |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
295 | 299 |
296 void IOSChromeMainParts::StartMetricsRecording() { | 300 void IOSChromeMainParts::StartMetricsRecording() { |
297 bool wifiOnly = local_state_->GetBoolean(prefs::kMetricsReportingWifiOnly); | 301 bool wifiOnly = local_state_->GetBoolean(prefs::kMetricsReportingWifiOnly); |
298 bool isConnectionCellular = net::NetworkChangeNotifier::IsConnectionCellular( | 302 bool isConnectionCellular = net::NetworkChangeNotifier::IsConnectionCellular( |
299 net::NetworkChangeNotifier::GetConnectionType()); | 303 net::NetworkChangeNotifier::GetConnectionType()); |
300 bool mayUpload = !wifiOnly || !isConnectionCellular; | 304 bool mayUpload = !wifiOnly || !isConnectionCellular; |
301 | 305 |
302 application_context_->GetMetricsServicesManager()->UpdateUploadPermissions( | 306 application_context_->GetMetricsServicesManager()->UpdateUploadPermissions( |
303 mayUpload); | 307 mayUpload); |
304 } | 308 } |
OLD | NEW |