| 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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 BOOL postCrashLaunch = [self mustShowRestoreInfobar]; | 673 BOOL postCrashLaunch = [self mustShowRestoreInfobar]; |
| 674 if (postCrashLaunch) { | 674 if (postCrashLaunch) { |
| 675 _restoreHelper = | 675 _restoreHelper = |
| 676 [[CrashRestoreHelper alloc] initWithBrowserState:chromeBrowserState]; | 676 [[CrashRestoreHelper alloc] initWithBrowserState:chromeBrowserState]; |
| 677 [_restoreHelper moveAsideSessionInformation]; | 677 [_restoreHelper moveAsideSessionInformation]; |
| 678 } | 678 } |
| 679 | 679 |
| 680 // Initialize and set the main browser state. | 680 // Initialize and set the main browser state. |
| 681 [self initializeBrowserState:chromeBrowserState]; | 681 [self initializeBrowserState:chromeBrowserState]; |
| 682 _mainBrowserState = chromeBrowserState; | 682 _mainBrowserState = chromeBrowserState; |
| 683 [_browserViewWrangler shutdown]; | |
| 684 _browserViewWrangler = | 683 _browserViewWrangler = |
| 685 [[BrowserViewWrangler alloc] initWithBrowserState:_mainBrowserState | 684 [[BrowserViewWrangler alloc] initWithBrowserState:_mainBrowserState |
| 686 tabModelObserver:self]; | 685 tabModelObserver:self]; |
| 687 // Ensure the main tab model is created. | 686 // Ensure the main tab model is created. |
| 688 ignore_result([_browserViewWrangler mainTabModel]); | 687 ignore_result([_browserViewWrangler mainTabModel]); |
| 689 | 688 |
| 690 _spotlightManager = | 689 _spotlightManager = |
| 691 [SpotlightManager spotlightManagerWithBrowserState:_mainBrowserState]; | 690 [SpotlightManager spotlightManagerWithBrowserState:_mainBrowserState]; |
| 692 | 691 |
| 693 ShareExtensionService* service = | 692 ShareExtensionService* service = |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 - (void)activateFirstUserActionRecorderWithBackgroundTime: | 903 - (void)activateFirstUserActionRecorderWithBackgroundTime: |
| 905 (NSTimeInterval)backgroundTime { | 904 (NSTimeInterval)backgroundTime { |
| 906 base::TimeDelta delta = base::TimeDelta::FromSeconds(backgroundTime); | 905 base::TimeDelta delta = base::TimeDelta::FromSeconds(backgroundTime); |
| 907 _firstUserActionRecorder.reset(new FirstUserActionRecorder(delta)); | 906 _firstUserActionRecorder.reset(new FirstUserActionRecorder(delta)); |
| 908 } | 907 } |
| 909 | 908 |
| 910 - (void)stopChromeMain { | 909 - (void)stopChromeMain { |
| 911 [_spotlightManager shutdown]; | 910 [_spotlightManager shutdown]; |
| 912 _spotlightManager = nil; | 911 _spotlightManager = nil; |
| 913 | 912 |
| 914 [_browserViewWrangler shutdown]; | |
| 915 _browserViewWrangler = nil; | 913 _browserViewWrangler = nil; |
| 916 | 914 |
| 917 _chromeMain.reset(); | 915 _chromeMain.reset(); |
| 918 } | 916 } |
| 919 | 917 |
| 920 - (BOOL)isTabSwitcherActive { | 918 - (BOOL)isTabSwitcherActive { |
| 921 return _tabSwitcherIsActive; | 919 return _tabSwitcherIsActive; |
| 922 } | 920 } |
| 923 | 921 |
| 924 #pragma mark - BrowserViewInformation implementation. | 922 #pragma mark - BrowserViewInformation implementation. |
| (...skipping 1621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2546 newChromeAppStartupParametersWithURL:net::NSURLWithGURL(launchURL) | 2544 newChromeAppStartupParametersWithURL:net::NSURLWithGURL(launchURL) |
| 2547 fromSourceApplication:sourceApplication]; | 2545 fromSourceApplication:sourceApplication]; |
| 2548 } | 2546 } |
| 2549 | 2547 |
| 2550 - (void)setUpAsForegrounded { | 2548 - (void)setUpAsForegrounded { |
| 2551 _isColdStart = NO; | 2549 _isColdStart = NO; |
| 2552 _browserInitializationStage = INITIALIZATION_STAGE_FOREGROUND; | 2550 _browserInitializationStage = INITIALIZATION_STAGE_FOREGROUND; |
| 2553 // Create a BrowserViewWrangler with a null browser state. This will trigger | 2551 // Create a BrowserViewWrangler with a null browser state. This will trigger |
| 2554 // assertions if the BrowserViewWrangler is asked to create any BVC or | 2552 // assertions if the BrowserViewWrangler is asked to create any BVC or |
| 2555 // tabModel objects, but it will accept assignments to them. | 2553 // tabModel objects, but it will accept assignments to them. |
| 2556 [_browserViewWrangler shutdown]; | |
| 2557 _browserViewWrangler = | 2554 _browserViewWrangler = |
| 2558 [[BrowserViewWrangler alloc] initWithBrowserState:nullptr | 2555 [[BrowserViewWrangler alloc] initWithBrowserState:nullptr |
| 2559 tabModelObserver:self]; | 2556 tabModelObserver:self]; |
| 2560 // This is a test utility method that bypasses the ususal setup steps, so | 2557 // This is a test utility method that bypasses the ususal setup steps, so |
| 2561 // verify that the main coordinator hasn't been created yet, then start it | 2558 // verify that the main coordinator hasn't been created yet, then start it |
| 2562 // via lazy initialization. | 2559 // via lazy initialization. |
| 2563 DCHECK(!_mainCoordinator); | 2560 DCHECK(!_mainCoordinator); |
| 2564 [self.mainCoordinator start]; | 2561 [self.mainCoordinator start]; |
| 2565 } | 2562 } |
| 2566 | 2563 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2581 }; | 2578 }; |
| 2582 | 2579 |
| 2583 callbackCounter->IncrementCount(); | 2580 callbackCounter->IncrementCount(); |
| 2584 [self removeBrowsingDataFromBrowserState:_mainBrowserState | 2581 [self removeBrowsingDataFromBrowserState:_mainBrowserState |
| 2585 mask:removeAllMask | 2582 mask:removeAllMask |
| 2586 timePeriod:browsing_data::TimePeriod::ALL_TIME | 2583 timePeriod:browsing_data::TimePeriod::ALL_TIME |
| 2587 completionHandler:decrementCallbackCounterCount]; | 2584 completionHandler:decrementCallbackCounterCount]; |
| 2588 } | 2585 } |
| 2589 | 2586 |
| 2590 @end | 2587 @end |
| OLD | NEW |