| 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" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/time/default_tick_clock.h" | 12 #include "base/time/default_tick_clock.h" |
| 13 #include "components/content_settings/core/browser/cookie_settings.h" | 13 #include "components/content_settings/core/browser/cookie_settings.h" |
| 14 #include "components/content_settings/core/common/content_settings_pattern.h" | 14 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 15 #include "components/flags_ui/pref_service_flags_storage.h" | 15 #include "components/flags_ui/pref_service_flags_storage.h" |
| 16 #include "components/language_usage_metrics/language_usage_metrics.h" | 16 #include "components/language_usage_metrics/language_usage_metrics.h" |
| 17 #include "components/metrics/metrics_service.h" | 17 #include "components/metrics/metrics_service.h" |
| 18 #include "components/metrics/profiler/ios/ios_tracking_synchronizer_delegate.h" | 18 #include "components/metrics/profiler/ios/ios_tracking_synchronizer_delegate.h" |
| 19 #include "components/metrics/profiler/tracking_synchronizer.h" | 19 #include "components/metrics/profiler/tracking_synchronizer.h" |
| 20 #include "components/metrics_services_manager/metrics_services_manager.h" | 20 #include "components/metrics_services_manager/metrics_services_manager.h" |
| 21 #include "components/open_from_clipboard/clipboard_recent_content.h" | 21 #include "components/open_from_clipboard/clipboard_recent_content.h" |
| 22 #include "components/prefs/json_pref_store.h" | 22 #include "components/prefs/json_pref_store.h" |
| 23 #include "components/prefs/pref_service.h" | 23 #include "components/prefs/pref_service.h" |
| 24 #include "components/rappor/rappor_service.h" | 24 #include "components/rappor/rappor_service.h" |
| 25 #include "components/translate/core/browser/translate_download_manager.h" | 25 #include "components/translate/core/browser/translate_download_manager.h" |
| 26 #include "components/variations/service/variations_service.h" | 26 #include "components/variations/service/variations_service.h" |
| 27 #include "components/variations/variations_http_header_provider.h" | 27 #include "components/variations/variations_http_header_provider.h" |
| 28 #include "ios/chrome/browser/about_flags.h" | 28 #include "ios/chrome/browser/about_flags.h" |
| 29 #include "ios/chrome/browser/application_context_impl.h" | 29 #include "ios/chrome/browser/application_context_impl.h" |
| 30 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" |
| 30 #include "ios/chrome/browser/chrome_paths.h" | 31 #include "ios/chrome/browser/chrome_paths.h" |
| 31 #include "ios/chrome/browser/chrome_switches.h" | 32 #include "ios/chrome/browser/chrome_switches.h" |
| 32 #include "ios/chrome/browser/chrome_url_constants.h" | 33 #include "ios/chrome/browser/chrome_url_constants.h" |
| 33 #import "ios/chrome/browser/first_run/first_run.h" | 34 #import "ios/chrome/browser/first_run/first_run.h" |
| 34 #include "ios/chrome/browser/install_time_util.h" | 35 #include "ios/chrome/browser/install_time_util.h" |
| 35 #include "ios/chrome/browser/ios_chrome_field_trials.h" | 36 #include "ios/chrome/browser/ios_chrome_field_trials.h" |
| 36 #include "ios/chrome/browser/metrics/field_trial_synchronizer.h" | 37 #include "ios/chrome/browser/metrics/field_trial_synchronizer.h" |
| 37 #include "ios/chrome/browser/open_from_clipboard/create_clipboard_recent_content
.h" | 38 #include "ios/chrome/browser/open_from_clipboard/create_clipboard_recent_content
.h" |
| 38 #include "ios/chrome/browser/pref_names.h" | 39 #include "ios/chrome/browser/pref_names.h" |
| 39 #include "ios/chrome/browser/translate/translate_service_ios.h" | 40 #include "ios/chrome/browser/translate/translate_service_ios.h" |
| 40 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.
h" | |
| 41 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state_
manager.h" | 41 #include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state_
manager.h" |
| 42 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" | 42 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" |
| 43 #include "ios/web/public/web_thread.h" | 43 #include "ios/web/public/web_thread.h" |
| 44 #include "net/base/network_change_notifier.h" | 44 #include "net/base/network_change_notifier.h" |
| 45 #include "net/http/http_network_layer.h" | 45 #include "net/http/http_network_layer.h" |
| 46 #include "net/http/http_stream_factory.h" | 46 #include "net/http/http_stream_factory.h" |
| 47 #include "net/url_request/url_request.h" | 47 #include "net/url_request/url_request.h" |
| 48 #include "ui/base/l10n/l10n_util_mac.h" | 48 #include "ui/base/l10n/l10n_util_mac.h" |
| 49 #include "ui/base/resource/resource_bundle.h" | 49 #include "ui/base/resource/resource_bundle.h" |
| 50 | 50 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 242 |
| 243 void IOSChromeMainParts::StartMetricsRecording() { | 243 void IOSChromeMainParts::StartMetricsRecording() { |
| 244 bool wifiOnly = local_state_->GetBoolean(prefs::kMetricsReportingWifiOnly); | 244 bool wifiOnly = local_state_->GetBoolean(prefs::kMetricsReportingWifiOnly); |
| 245 bool isConnectionCellular = net::NetworkChangeNotifier::IsConnectionCellular( | 245 bool isConnectionCellular = net::NetworkChangeNotifier::IsConnectionCellular( |
| 246 net::NetworkChangeNotifier::GetConnectionType()); | 246 net::NetworkChangeNotifier::GetConnectionType()); |
| 247 bool mayUpload = !wifiOnly || !isConnectionCellular; | 247 bool mayUpload = !wifiOnly || !isConnectionCellular; |
| 248 | 248 |
| 249 application_context_->GetMetricsServicesManager()->UpdateUploadPermissions( | 249 application_context_->GetMetricsServicesManager()->UpdateUploadPermissions( |
| 250 mayUpload); | 250 mayUpload); |
| 251 } | 251 } |
| OLD | NEW |