| 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 identity:(ChromeIdentity*)identity | 375 identity:(ChromeIdentity*)identity |
| 376 accessPoint:(signin_metrics::AccessPoint)accessPoint | 376 accessPoint:(signin_metrics::AccessPoint)accessPoint |
| 377 promoAction:(signin_metrics::PromoAction)promoAction | 377 promoAction:(signin_metrics::PromoAction)promoAction |
| 378 callback:(ShowSigninCommandCompletionCallback)callback; | 378 callback:(ShowSigninCommandCompletionCallback)callback; |
| 379 // Wraps a callback with one that first checks if sign-in was completed | 379 // Wraps a callback with one that first checks if sign-in was completed |
| 380 // successfully and the profile wasn't swapped before invoking. | 380 // successfully and the profile wasn't swapped before invoking. |
| 381 - (ShowSigninCommandCompletionCallback)successfulSigninCompletion: | 381 - (ShowSigninCommandCompletionCallback)successfulSigninCompletion: |
| 382 (ProceduralBlock)callback; | 382 (ProceduralBlock)callback; |
| 383 // Shows the Sync encryption passphrase (part of Settings). | 383 // Shows the Sync encryption passphrase (part of Settings). |
| 384 - (void)showSyncEncryptionPassphrase; | 384 - (void)showSyncEncryptionPassphrase; |
| 385 // Shows the Native Apps Settings UI (part of Settings). | |
| 386 - (void)showNativeAppsSettings; | |
| 387 // Shows the Clear Browsing Data Settings UI (part of Settings). | 385 // Shows the Clear Browsing Data Settings UI (part of Settings). |
| 388 - (void)showClearBrowsingDataSettingsController; | 386 - (void)showClearBrowsingDataSettingsController; |
| 389 // Shows the Contextual search UI (part of Settings). | 387 // Shows the Contextual search UI (part of Settings). |
| 390 - (void)showContextualSearchSettingsController; | 388 - (void)showContextualSearchSettingsController; |
| 391 // Shows the tab switcher UI. | 389 // Shows the tab switcher UI. |
| 392 - (void)showTabSwitcher; | 390 - (void)showTabSwitcher; |
| 393 // Starts a voice search on the current BVC. | 391 // Starts a voice search on the current BVC. |
| 394 - (void)startVoiceSearch; | 392 - (void)startVoiceSearch; |
| 395 // Dismisses the tab switcher UI without animation into the given model. | 393 // Dismisses the tab switcher UI without animation into the given model. |
| 396 - (void)dismissTabSwitcherWithoutAnimationInModel:(TabModel*)tabModel; | 394 - (void)dismissTabSwitcherWithoutAnimationInModel:(TabModel*)tabModel; |
| (...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1464 browsing_data::CalculateBeginDeleteTime(timePeriod); | 1462 browsing_data::CalculateBeginDeleteTime(timePeriod); |
| 1465 [ChromeWebViewFactory clearExternalCookies:browserState | 1463 [ChromeWebViewFactory clearExternalCookies:browserState |
| 1466 fromTime:beginDeleteTime | 1464 fromTime:beginDeleteTime |
| 1467 toTime:base::Time::Max()]; | 1465 toTime:base::Time::Max()]; |
| 1468 } | 1466 } |
| 1469 break; | 1467 break; |
| 1470 } | 1468 } |
| 1471 case IDC_RESET_ALL_WEBVIEWS: | 1469 case IDC_RESET_ALL_WEBVIEWS: |
| 1472 [self.currentBVC resetAllWebViews]; | 1470 [self.currentBVC resetAllWebViews]; |
| 1473 break; | 1471 break; |
| 1474 case IDC_SHOW_GOOGLE_APPS_SETTINGS: | |
| 1475 [self showNativeAppsSettings]; | |
| 1476 break; | |
| 1477 case IDC_SHOW_CLEAR_BROWSING_DATA_SETTINGS: | 1472 case IDC_SHOW_CLEAR_BROWSING_DATA_SETTINGS: |
| 1478 [self showClearBrowsingDataSettingsController]; | 1473 [self showClearBrowsingDataSettingsController]; |
| 1479 break; | 1474 break; |
| 1480 case IDC_SHOW_CONTEXTUAL_SEARCH_SETTINGS: | 1475 case IDC_SHOW_CONTEXTUAL_SEARCH_SETTINGS: |
| 1481 [self showContextualSearchSettingsController]; | 1476 [self showContextualSearchSettingsController]; |
| 1482 break; | 1477 break; |
| 1483 case IDC_CLOSE_MODALS: | 1478 case IDC_CLOSE_MODALS: |
| 1484 [self dismissModalDialogsWithCompletion:nil]; | 1479 [self dismissModalDialogsWithCompletion:nil]; |
| 1485 break; | 1480 break; |
| 1486 case IDC_SHOW_ADD_ACCOUNT: | 1481 case IDC_SHOW_ADD_ACCOUNT: |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2136 return; | 2131 return; |
| 2137 } | 2132 } |
| 2138 DCHECK_EQ(self.mainBVC, self.currentBVC); | 2133 DCHECK_EQ(self.mainBVC, self.currentBVC); |
| 2139 SigninManager* signinManager = | 2134 SigninManager* signinManager = |
| 2140 ios::SigninManagerFactory::GetForBrowserState(browserState); | 2135 ios::SigninManagerFactory::GetForBrowserState(browserState); |
| 2141 if (signinManager->IsAuthenticated()) | 2136 if (signinManager->IsAuthenticated()) |
| 2142 callback(); | 2137 callback(); |
| 2143 } copy]; | 2138 } copy]; |
| 2144 } | 2139 } |
| 2145 | 2140 |
| 2146 - (void)showNativeAppsSettings { | |
| 2147 if (_settingsNavigationController) | |
| 2148 return; | |
| 2149 _settingsNavigationController = | |
| 2150 [SettingsNavigationController newNativeAppsController:_mainBrowserState | |
| 2151 delegate:self]; | |
| 2152 [[self topPresentedViewController] | |
| 2153 presentViewController:_settingsNavigationController | |
| 2154 animated:YES | |
| 2155 completion:nil]; | |
| 2156 } | |
| 2157 | |
| 2158 - (void)closeSettingsAnimated:(BOOL)animated | 2141 - (void)closeSettingsAnimated:(BOOL)animated |
| 2159 completion:(ProceduralBlock)completion { | 2142 completion:(ProceduralBlock)completion { |
| 2160 DCHECK(_settingsNavigationController); | 2143 DCHECK(_settingsNavigationController); |
| 2161 [_settingsNavigationController settingsWillBeDismissed]; | 2144 [_settingsNavigationController settingsWillBeDismissed]; |
| 2162 UIViewController* presentingViewController = | 2145 UIViewController* presentingViewController = |
| 2163 [_settingsNavigationController presentingViewController]; | 2146 [_settingsNavigationController presentingViewController]; |
| 2164 DCHECK(presentingViewController); | 2147 DCHECK(presentingViewController); |
| 2165 [presentingViewController dismissViewControllerAnimated:animated | 2148 [presentingViewController dismissViewControllerAnimated:animated |
| 2166 completion:^{ | 2149 completion:^{ |
| 2167 if (completion) | 2150 if (completion) |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2580 }; | 2563 }; |
| 2581 | 2564 |
| 2582 callbackCounter->IncrementCount(); | 2565 callbackCounter->IncrementCount(); |
| 2583 [self removeBrowsingDataFromBrowserState:_mainBrowserState | 2566 [self removeBrowsingDataFromBrowserState:_mainBrowserState |
| 2584 mask:removeAllMask | 2567 mask:removeAllMask |
| 2585 timePeriod:browsing_data::TimePeriod::ALL_TIME | 2568 timePeriod:browsing_data::TimePeriod::ALL_TIME |
| 2586 completionHandler:decrementCallbackCounterCount]; | 2569 completionHandler:decrementCallbackCounterCount]; |
| 2587 } | 2570 } |
| 2588 | 2571 |
| 2589 @end | 2572 @end |
| OLD | NEW |