Chromium Code Reviews| 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 11 matching lines...) Expand all Loading... | |
| 22 #import "base/mac/scoped_nsobject.h" | 22 #import "base/mac/scoped_nsobject.h" |
| 23 #include "base/macros.h" | 23 #include "base/macros.h" |
| 24 #include "base/path_service.h" | 24 #include "base/path_service.h" |
| 25 #include "base/strings/sys_string_conversions.h" | 25 #include "base/strings/sys_string_conversions.h" |
| 26 #include "base/time/time.h" | 26 #include "base/time/time.h" |
| 27 #include "components/component_updater/component_updater_service.h" | 27 #include "components/component_updater/component_updater_service.h" |
| 28 #include "components/content_settings/core/browser/host_content_settings_map.h" | 28 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 29 #include "components/metrics/metrics_pref_names.h" | 29 #include "components/metrics/metrics_pref_names.h" |
| 30 #include "components/metrics/metrics_service.h" | 30 #include "components/metrics/metrics_service.h" |
| 31 #include "components/prefs/pref_change_registrar.h" | 31 #include "components/prefs/pref_change_registrar.h" |
| 32 #include "components/reading_list/core/reading_list_switches.h" | |
| 33 #include "components/signin/core/browser/signin_manager.h" | 32 #include "components/signin/core/browser/signin_manager.h" |
| 34 #include "components/url_formatter/url_formatter.h" | 33 #include "components/url_formatter/url_formatter.h" |
| 35 #include "components/web_resource/web_resource_pref_names.h" | 34 #include "components/web_resource/web_resource_pref_names.h" |
| 36 #import "ios/chrome/app/application_delegate/app_state.h" | 35 #import "ios/chrome/app/application_delegate/app_state.h" |
| 37 #import "ios/chrome/app/application_delegate/background_activity.h" | 36 #import "ios/chrome/app/application_delegate/background_activity.h" |
| 38 #import "ios/chrome/app/application_delegate/metrics_mediator.h" | 37 #import "ios/chrome/app/application_delegate/metrics_mediator.h" |
| 39 #import "ios/chrome/app/application_delegate/url_opener.h" | 38 #import "ios/chrome/app/application_delegate/url_opener.h" |
| 40 #include "ios/chrome/app/application_mode.h" | 39 #include "ios/chrome/app/application_mode.h" |
| 41 #include "ios/chrome/app/chrome_app_startup_parameters.h" | 40 #include "ios/chrome/app/chrome_app_startup_parameters.h" |
| 42 #import "ios/chrome/app/deferred_initialization_runner.h" | 41 #import "ios/chrome/app/deferred_initialization_runner.h" |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 693 _mainBrowserState = chromeBrowserState; | 692 _mainBrowserState = chromeBrowserState; |
| 694 _browserViewWrangler.reset([[BrowserViewWrangler alloc] | 693 _browserViewWrangler.reset([[BrowserViewWrangler alloc] |
| 695 initWithBrowserState:_mainBrowserState | 694 initWithBrowserState:_mainBrowserState |
| 696 tabModelObserver:self]); | 695 tabModelObserver:self]); |
| 697 // Ensure the main tab model is created. | 696 // Ensure the main tab model is created. |
| 698 ignore_result([_browserViewWrangler mainTabModel]); | 697 ignore_result([_browserViewWrangler mainTabModel]); |
| 699 | 698 |
| 700 _spotlightManager.reset([[SpotlightManager | 699 _spotlightManager.reset([[SpotlightManager |
| 701 spotlightManagerWithBrowserState:_mainBrowserState] retain]); | 700 spotlightManagerWithBrowserState:_mainBrowserState] retain]); |
| 702 | 701 |
| 703 if (reading_list::switches::IsReadingListEnabled()) { | |
| 704 ShareExtensionService* service = | 702 ShareExtensionService* service = |
|
Olivier
2017/03/23 10:24:26
reindent in all files
gambard
2017/03/23 10:47:47
Done.
| |
| 705 ShareExtensionServiceFactory::GetForBrowserState(_mainBrowserState); | 703 ShareExtensionServiceFactory::GetForBrowserState(_mainBrowserState); |
| 706 service->Initialize(); | 704 service->Initialize(); |
| 707 } | |
| 708 | 705 |
| 709 // Before bringing up the UI, make sure the launch mode is correct, and | 706 // Before bringing up the UI, make sure the launch mode is correct, and |
| 710 // check for previous crashes. | 707 // check for previous crashes. |
| 711 BOOL startInIncognito = [standardDefaults boolForKey:kIncognitoCurrentKey]; | 708 BOOL startInIncognito = [standardDefaults boolForKey:kIncognitoCurrentKey]; |
| 712 BOOL switchFromIncognito = startInIncognito && ![self canLaunchInIncognito]; | 709 BOOL switchFromIncognito = startInIncognito && ![self canLaunchInIncognito]; |
| 713 | 710 |
| 714 if (postCrashLaunch || switchFromIncognito) { | 711 if (postCrashLaunch || switchFromIncognito) { |
| 715 [self clearIOSSpecificIncognitoData]; | 712 [self clearIOSSpecificIncognitoData]; |
| 716 if (switchFromIncognito) | 713 if (switchFromIncognito) |
| 717 [self switchGlobalStateToMode:ApplicationMode::NORMAL]; | 714 [self switchGlobalStateToMode:ApplicationMode::NORMAL]; |
| (...skipping 1882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2600 }; | 2597 }; |
| 2601 | 2598 |
| 2602 callbackCounter->IncrementCount(); | 2599 callbackCounter->IncrementCount(); |
| 2603 [self removeBrowsingDataFromBrowserState:_mainBrowserState | 2600 [self removeBrowsingDataFromBrowserState:_mainBrowserState |
| 2604 mask:removeAllMask | 2601 mask:removeAllMask |
| 2605 timePeriod:browsing_data::TimePeriod::ALL_TIME | 2602 timePeriod:browsing_data::TimePeriod::ALL_TIME |
| 2606 completionHandler:decrementCallbackCounterCount]; | 2603 completionHandler:decrementCallbackCounterCount]; |
| 2607 } | 2604 } |
| 2608 | 2605 |
| 2609 @end | 2606 @end |
| OLD | NEW |