| 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 27 matching lines...) Expand all Loading... |
| 38 #import "ios/chrome/app/application_delegate/metrics_mediator.h" | 38 #import "ios/chrome/app/application_delegate/metrics_mediator.h" |
| 39 #import "ios/chrome/app/application_delegate/url_opener.h" | 39 #import "ios/chrome/app/application_delegate/url_opener.h" |
| 40 #include "ios/chrome/app/application_mode.h" | 40 #include "ios/chrome/app/application_mode.h" |
| 41 #include "ios/chrome/app/chrome_app_startup_parameters.h" | 41 #include "ios/chrome/app/chrome_app_startup_parameters.h" |
| 42 #import "ios/chrome/app/deferred_initialization_runner.h" | 42 #import "ios/chrome/app/deferred_initialization_runner.h" |
| 43 #import "ios/chrome/app/main_controller_private.h" | 43 #import "ios/chrome/app/main_controller_private.h" |
| 44 #import "ios/chrome/app/memory_monitor.h" | 44 #import "ios/chrome/app/memory_monitor.h" |
| 45 #import "ios/chrome/app/safe_mode_crashing_modules_config.h" | 45 #import "ios/chrome/app/safe_mode_crashing_modules_config.h" |
| 46 #import "ios/chrome/app/spotlight/spotlight_manager.h" | 46 #import "ios/chrome/app/spotlight/spotlight_manager.h" |
| 47 #import "ios/chrome/app/spotlight/spotlight_util.h" | 47 #import "ios/chrome/app/spotlight/spotlight_util.h" |
| 48 #include "ios/chrome/app/startup/background_upload_alert.h" |
| 48 #include "ios/chrome/app/startup/chrome_main_starter.h" | 49 #include "ios/chrome/app/startup/chrome_main_starter.h" |
| 49 #include "ios/chrome/app/startup/client_registration.h" | 50 #include "ios/chrome/app/startup/client_registration.h" |
| 50 #include "ios/chrome/app/startup/ios_chrome_main.h" | 51 #include "ios/chrome/app/startup/ios_chrome_main.h" |
| 51 #include "ios/chrome/app/startup/network_stack_setup.h" | 52 #include "ios/chrome/app/startup/network_stack_setup.h" |
| 52 #include "ios/chrome/app/startup/provider_registration.h" | 53 #include "ios/chrome/app/startup/provider_registration.h" |
| 53 #include "ios/chrome/app/startup/register_experimental_settings.h" | 54 #include "ios/chrome/app/startup/register_experimental_settings.h" |
| 54 #include "ios/chrome/app/startup/setup_debugging.h" | 55 #include "ios/chrome/app/startup/setup_debugging.h" |
| 55 #import "ios/chrome/app/startup_tasks.h" | 56 #import "ios/chrome/app/startup_tasks.h" |
| 56 #include "ios/chrome/app/tests_hook.h" | 57 #include "ios/chrome/app/tests_hook.h" |
| 57 #import "ios/chrome/browser/app_startup_parameters.h" | 58 #import "ios/chrome/browser/app_startup_parameters.h" |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 // Resets the interval stats between two background fetch as this value may be | 671 // Resets the interval stats between two background fetch as this value may be |
| 671 // obsolete. | 672 // obsolete. |
| 672 [BackgroundActivity foregroundStarted]; | 673 [BackgroundActivity foregroundStarted]; |
| 673 | 674 |
| 674 // Crash the app during startup if requested but only after we have enabled | 675 // Crash the app during startup if requested but only after we have enabled |
| 675 // uploading crash reports. | 676 // uploading crash reports. |
| 676 [self crashIfRequested]; | 677 [self crashIfRequested]; |
| 677 | 678 |
| 678 RegisterComponentsForUpdate(); | 679 RegisterComponentsForUpdate(); |
| 679 | 680 |
| 680 if (experimental_flags::IsAlertOnBackgroundUploadEnabled()) { | 681 [BackgroundUploadAlert setupBackgroundUploadAlert]; |
| 681 if ([UIApplication instancesRespondToSelector: | |
| 682 @selector(registerUserNotificationSettings:)]) { | |
| 683 [[UIApplication sharedApplication] | |
| 684 registerUserNotificationSettings: | |
| 685 [UIUserNotificationSettings | |
| 686 settingsForTypes:UIUserNotificationTypeAlert | | |
| 687 UIUserNotificationTypeBadge | | |
| 688 UIUserNotificationTypeSound | |
| 689 categories:nil]]; | |
| 690 } | |
| 691 } | |
| 692 | 682 |
| 693 // Remove the extra browser states as Chrome iOS is single profile in M48+. | 683 // Remove the extra browser states as Chrome iOS is single profile in M48+. |
| 694 ChromeBrowserStateRemovalController::GetInstance() | 684 ChromeBrowserStateRemovalController::GetInstance() |
| 695 ->RemoveBrowserStatesIfNecessary(); | 685 ->RemoveBrowserStatesIfNecessary(); |
| 696 | 686 |
| 697 _browserStateManager = | 687 _browserStateManager = |
| 698 GetApplicationContext()->GetChromeBrowserStateManager(); | 688 GetApplicationContext()->GetChromeBrowserStateManager(); |
| 699 ios::ChromeBrowserState* chromeBrowserState = | 689 ios::ChromeBrowserState* chromeBrowserState = |
| 700 _browserStateManager->GetLastUsedBrowserState(); | 690 _browserStateManager->GetLastUsedBrowserState(); |
| 701 | 691 |
| (...skipping 1994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2696 }; | 2686 }; |
| 2697 | 2687 |
| 2698 callbackCounter->IncrementCount(); | 2688 callbackCounter->IncrementCount(); |
| 2699 [self removeBrowsingDataFromBrowserState:_mainBrowserState | 2689 [self removeBrowsingDataFromBrowserState:_mainBrowserState |
| 2700 mask:removeAllMask | 2690 mask:removeAllMask |
| 2701 timePeriod:browsing_data::ALL_TIME | 2691 timePeriod:browsing_data::ALL_TIME |
| 2702 completionHandler:decrementCallbackCounterCount]; | 2692 completionHandler:decrementCallbackCounterCount]; |
| 2703 } | 2693 } |
| 2704 | 2694 |
| 2705 @end | 2695 @end |
| OLD | NEW |