| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #import "ios/chrome/app/main_controller.h" | 5 #import "ios/chrome/app/main_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #import <CoreSpotlight/CoreSpotlight.h> | 10 #import <CoreSpotlight/CoreSpotlight.h> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 #include "ios/chrome/browser/browsing_data/ios_chrome_browsing_data_remover.h" | 64 #include "ios/chrome/browser/browsing_data/ios_chrome_browsing_data_remover.h" |
| 65 #include "ios/chrome/browser/callback_counter.h" | 65 #include "ios/chrome/browser/callback_counter.h" |
| 66 #include "ios/chrome/browser/chrome_paths.h" | 66 #include "ios/chrome/browser/chrome_paths.h" |
| 67 #include "ios/chrome/browser/chrome_url_constants.h" | 67 #include "ios/chrome/browser/chrome_url_constants.h" |
| 68 #import "ios/chrome/browser/chrome_url_util.h" | 68 #import "ios/chrome/browser/chrome_url_util.h" |
| 69 #include "ios/chrome/browser/content_settings/host_content_settings_map_factory.
h" | 69 #include "ios/chrome/browser/content_settings/host_content_settings_map_factory.
h" |
| 70 #include "ios/chrome/browser/crash_loop_detection_util.h" | 70 #include "ios/chrome/browser/crash_loop_detection_util.h" |
| 71 #include "ios/chrome/browser/crash_report/breakpad_helper.h" | 71 #include "ios/chrome/browser/crash_report/breakpad_helper.h" |
| 72 #import "ios/chrome/browser/crash_report/crash_report_background_uploader.h" | 72 #import "ios/chrome/browser/crash_report/crash_report_background_uploader.h" |
| 73 #import "ios/chrome/browser/crash_report/crash_restore_helper.h" | 73 #import "ios/chrome/browser/crash_report/crash_restore_helper.h" |
| 74 #include "ios/chrome/browser/desktop_promotion/desktop_promotion_sync_observer.h
" |
| 74 #include "ios/chrome/browser/experimental_flags.h" | 75 #include "ios/chrome/browser/experimental_flags.h" |
| 75 #include "ios/chrome/browser/file_metadata_util.h" | 76 #include "ios/chrome/browser/file_metadata_util.h" |
| 76 #import "ios/chrome/browser/first_run/first_run.h" | 77 #import "ios/chrome/browser/first_run/first_run.h" |
| 77 #include "ios/chrome/browser/geolocation/omnibox_geolocation_controller.h" | 78 #include "ios/chrome/browser/geolocation/omnibox_geolocation_controller.h" |
| 78 #include "ios/chrome/browser/ios_chrome_io_thread.h" | 79 #include "ios/chrome/browser/ios_chrome_io_thread.h" |
| 79 #import "ios/chrome/browser/memory/memory_debugger_manager.h" | 80 #import "ios/chrome/browser/memory/memory_debugger_manager.h" |
| 80 #include "ios/chrome/browser/metrics/first_user_action_recorder.h" | 81 #include "ios/chrome/browser/metrics/first_user_action_recorder.h" |
| 81 #import "ios/chrome/browser/metrics/previous_session_info.h" | 82 #import "ios/chrome/browser/metrics/previous_session_info.h" |
| 82 #import "ios/chrome/browser/net/cookie_util.h" | 83 #import "ios/chrome/browser/net/cookie_util.h" |
| 83 #include "ios/chrome/browser/net/crl_set_fetcher.h" | 84 #include "ios/chrome/browser/net/crl_set_fetcher.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 // been processed in the last 200ms in order to only allow processing one at | 334 // been processed in the last 200ms in order to only allow processing one at |
| 334 // a time. | 335 // a time. |
| 335 // TODO(crbug.com/560296): Provide a general solution for handling mutually | 336 // TODO(crbug.com/560296): Provide a general solution for handling mutually |
| 336 // exclusive chrome commands sent at nearly the same time. | 337 // exclusive chrome commands sent at nearly the same time. |
| 337 BOOL _isProcessingTabSwitcherCommand; | 338 BOOL _isProcessingTabSwitcherCommand; |
| 338 BOOL _isProcessingVoiceSearchCommand; | 339 BOOL _isProcessingVoiceSearchCommand; |
| 339 | 340 |
| 340 // Bridge to listen to pref changes. | 341 // Bridge to listen to pref changes. |
| 341 std::unique_ptr<PrefObserverBridge> _localStatePrefObserverBridge; | 342 std::unique_ptr<PrefObserverBridge> _localStatePrefObserverBridge; |
| 342 | 343 |
| 344 // Sync service observer for the desktop ios promotion logging. |
| 345 std::unique_ptr<DesktopPromotionSyncObserver> _desktopPromotionSyncObserver; |
| 346 |
| 343 // Registrar for pref changes notifications to the local state. | 347 // Registrar for pref changes notifications to the local state. |
| 344 PrefChangeRegistrar _localStatePrefChangeRegistrar; | 348 PrefChangeRegistrar _localStatePrefChangeRegistrar; |
| 345 | 349 |
| 346 // Clears browsing data from ChromeBrowserStates. | 350 // Clears browsing data from ChromeBrowserStates. |
| 347 base::scoped_nsobject<BrowsingDataRemovalController> | 351 base::scoped_nsobject<BrowsingDataRemovalController> |
| 348 _browsingDataRemovalController; | 352 _browsingDataRemovalController; |
| 349 | 353 |
| 350 // The class in charge of showing/hiding the memory debugger when the | 354 // The class in charge of showing/hiding the memory debugger when the |
| 351 // appropriate pref changes. | 355 // appropriate pref changes. |
| 352 base::scoped_nsobject<MemoryDebuggerManager> _memoryDebuggerManager; | 356 base::scoped_nsobject<MemoryDebuggerManager> _memoryDebuggerManager; |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 new PrefObserverBridge(self)); | 1060 new PrefObserverBridge(self)); |
| 1057 _localStatePrefChangeRegistrar.Init( | 1061 _localStatePrefChangeRegistrar.Init( |
| 1058 GetApplicationContext()->GetLocalState()); | 1062 GetApplicationContext()->GetLocalState()); |
| 1059 _localStatePrefObserverBridge->ObserveChangesForPreference( | 1063 _localStatePrefObserverBridge->ObserveChangesForPreference( |
| 1060 metrics::prefs::kMetricsReportingEnabled, | 1064 metrics::prefs::kMetricsReportingEnabled, |
| 1061 &_localStatePrefChangeRegistrar); | 1065 &_localStatePrefChangeRegistrar); |
| 1062 _localStatePrefObserverBridge->ObserveChangesForPreference( | 1066 _localStatePrefObserverBridge->ObserveChangesForPreference( |
| 1063 prefs::kMetricsReportingWifiOnly, | 1067 prefs::kMetricsReportingWifiOnly, |
| 1064 &_localStatePrefChangeRegistrar); | 1068 &_localStatePrefChangeRegistrar); |
| 1065 | 1069 |
| 1070 // Track Sync state changes. |
| 1071 _desktopPromotionSyncObserver.reset( |
| 1072 new DesktopPromotionSyncObserver( |
| 1073 [self currentBrowserState])); |
| 1074 |
| 1066 // Calls the onPreferenceChanged function in case there was | 1075 // Calls the onPreferenceChanged function in case there was |
| 1067 // a | 1076 // a |
| 1068 // change to the observed preferences before the observer | 1077 // change to the observed preferences before the observer |
| 1069 // bridge was set up. | 1078 // bridge was set up. |
| 1070 [self onPreferenceChanged:metrics::prefs:: | 1079 [self onPreferenceChanged:metrics::prefs:: |
| 1071 kMetricsReportingEnabled]; | 1080 kMetricsReportingEnabled]; |
| 1072 [self onPreferenceChanged:prefs::kMetricsReportingWifiOnly]; | 1081 [self onPreferenceChanged:prefs::kMetricsReportingWifiOnly]; |
| 1073 }]; | 1082 }]; |
| 1074 } | 1083 } |
| 1075 | 1084 |
| (...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2703 }; | 2712 }; |
| 2704 | 2713 |
| 2705 callbackCounter->IncrementCount(); | 2714 callbackCounter->IncrementCount(); |
| 2706 [self removeBrowsingDataFromBrowserState:_mainBrowserState | 2715 [self removeBrowsingDataFromBrowserState:_mainBrowserState |
| 2707 mask:removeAllMask | 2716 mask:removeAllMask |
| 2708 timePeriod:browsing_data::ALL_TIME | 2717 timePeriod:browsing_data::ALL_TIME |
| 2709 completionHandler:decrementCallbackCounterCount]; | 2718 completionHandler:decrementCallbackCounterCount]; |
| 2710 } | 2719 } |
| 2711 | 2720 |
| 2712 @end | 2721 @end |
| OLD | NEW |