| 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 // Sets |currentBVC| as the root view controller for the window. | 388 // Sets |currentBVC| as the root view controller for the window. |
| 389 - (void)displayCurrentBVC; | 389 - (void)displayCurrentBVC; |
| 390 // Shows the settings UI. | 390 // Shows the settings UI. |
| 391 - (void)showSettings; | 391 - (void)showSettings; |
| 392 // Shows the accounts settings UI. | 392 // Shows the accounts settings UI. |
| 393 - (void)showAccountsSettings; | 393 - (void)showAccountsSettings; |
| 394 // Shows the Sync settings UI. | 394 // Shows the Sync settings UI. |
| 395 - (void)showSyncSettings; | 395 - (void)showSyncSettings; |
| 396 // Shows the Save Passwords settings. | 396 // Shows the Save Passwords settings. |
| 397 - (void)showSavePasswordsSettings; | 397 - (void)showSavePasswordsSettings; |
| 398 // Shows the Physical Web settings UI. | |
| 399 - (void)showPhysicalWebSettings; | |
| 400 // Invokes the sign in flow with the specified authentication operation and | 398 // Invokes the sign in flow with the specified authentication operation and |
| 401 // invokes |callback| when finished. | 399 // invokes |callback| when finished. |
| 402 - (void)showSignInWithOperation:(AuthenticationOperation)operation | 400 - (void)showSignInWithOperation:(AuthenticationOperation)operation |
| 403 signInAccessPoint:(signin_metrics::AccessPoint)signInAccessPoint | 401 signInAccessPoint:(signin_metrics::AccessPoint)signInAccessPoint |
| 404 callback:(ShowSigninCommandCompletionCallback)callback; | 402 callback:(ShowSigninCommandCompletionCallback)callback; |
| 405 // Wraps a callback with one that first checks if sign-in was completed | 403 // Wraps a callback with one that first checks if sign-in was completed |
| 406 // successfully and the profile wasn't swapped before invoking. | 404 // successfully and the profile wasn't swapped before invoking. |
| 407 - (ShowSigninCommandCompletionCallback)successfulSigninCompletion: | 405 - (ShowSigninCommandCompletionCallback)successfulSigninCompletion: |
| 408 (ProceduralBlock)callback; | 406 (ProceduralBlock)callback; |
| 409 // Shows the Sync encryption passphrase (part of Settings). | 407 // Shows the Sync encryption passphrase (part of Settings). |
| (...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1509 } | 1507 } |
| 1510 case IDC_SHOW_SYNC_SETTINGS: | 1508 case IDC_SHOW_SYNC_SETTINGS: |
| 1511 [self showSyncSettings]; | 1509 [self showSyncSettings]; |
| 1512 break; | 1510 break; |
| 1513 case IDC_SHOW_SYNC_PASSPHRASE_SETTINGS: | 1511 case IDC_SHOW_SYNC_PASSPHRASE_SETTINGS: |
| 1514 [self showSyncEncryptionPassphrase]; | 1512 [self showSyncEncryptionPassphrase]; |
| 1515 break; | 1513 break; |
| 1516 case IDC_SHOW_SAVE_PASSWORDS_SETTINGS: | 1514 case IDC_SHOW_SAVE_PASSWORDS_SETTINGS: |
| 1517 [self showSavePasswordsSettings]; | 1515 [self showSavePasswordsSettings]; |
| 1518 break; | 1516 break; |
| 1519 case IDC_SHOW_PHYSICAL_WEB_SETTINGS: | |
| 1520 [self showPhysicalWebSettings]; | |
| 1521 break; | |
| 1522 case IDC_SHOW_HISTORY: | 1517 case IDC_SHOW_HISTORY: |
| 1523 [self showHistory]; | 1518 [self showHistory]; |
| 1524 break; | 1519 break; |
| 1525 case IDC_TOGGLE_TAB_SWITCHER: | 1520 case IDC_TOGGLE_TAB_SWITCHER: |
| 1526 DCHECK(!_tabSwitcherIsActive); | 1521 DCHECK(!_tabSwitcherIsActive); |
| 1527 if ((!IsIPadIdiom() || experimental_flags::IsTabSwitcherEnabled()) && | 1522 if ((!IsIPadIdiom() || experimental_flags::IsTabSwitcherEnabled()) && |
| 1528 !_isProcessingVoiceSearchCommand) { | 1523 !_isProcessingVoiceSearchCommand) { |
| 1529 [self showTabSwitcher]; | 1524 [self showTabSwitcher]; |
| 1530 _isProcessingTabSwitcherCommand = YES; | 1525 _isProcessingTabSwitcherCommand = YES; |
| 1531 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, | 1526 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2098 return; | 2093 return; |
| 2099 _settingsNavigationController.reset([SettingsNavigationController | 2094 _settingsNavigationController.reset([SettingsNavigationController |
| 2100 newSavePasswordsController:_mainBrowserState | 2095 newSavePasswordsController:_mainBrowserState |
| 2101 delegate:self]); | 2096 delegate:self]); |
| 2102 [[self topPresentedViewController] | 2097 [[self topPresentedViewController] |
| 2103 presentViewController:_settingsNavigationController | 2098 presentViewController:_settingsNavigationController |
| 2104 animated:YES | 2099 animated:YES |
| 2105 completion:nil]; | 2100 completion:nil]; |
| 2106 } | 2101 } |
| 2107 | 2102 |
| 2108 - (void)showPhysicalWebSettings { | |
| 2109 if (_settingsNavigationController) | |
| 2110 return; | |
| 2111 _settingsNavigationController.reset([SettingsNavigationController | |
| 2112 newPhysicalWebController:_mainBrowserState | |
| 2113 delegate:self]); | |
| 2114 [[self topPresentedViewController] | |
| 2115 presentViewController:_settingsNavigationController | |
| 2116 animated:YES | |
| 2117 completion:nil]; | |
| 2118 } | |
| 2119 | |
| 2120 - (void)showReportAnIssue { | 2103 - (void)showReportAnIssue { |
| 2121 if (_settingsNavigationController) | 2104 if (_settingsNavigationController) |
| 2122 return; | 2105 return; |
| 2123 _settingsNavigationController.reset([SettingsNavigationController | 2106 _settingsNavigationController.reset([SettingsNavigationController |
| 2124 newUserFeedbackController:_mainBrowserState | 2107 newUserFeedbackController:_mainBrowserState |
| 2125 delegate:self | 2108 delegate:self |
| 2126 feedbackDataSource:self]); | 2109 feedbackDataSource:self]); |
| 2127 [[self topPresentedViewController] | 2110 [[self topPresentedViewController] |
| 2128 presentViewController:_settingsNavigationController | 2111 presentViewController:_settingsNavigationController |
| 2129 animated:YES | 2112 animated:YES |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2693 }; | 2676 }; |
| 2694 | 2677 |
| 2695 callbackCounter->IncrementCount(); | 2678 callbackCounter->IncrementCount(); |
| 2696 [self removeBrowsingDataFromBrowserState:_mainBrowserState | 2679 [self removeBrowsingDataFromBrowserState:_mainBrowserState |
| 2697 mask:removeAllMask | 2680 mask:removeAllMask |
| 2698 timePeriod:browsing_data::ALL_TIME | 2681 timePeriod:browsing_data::ALL_TIME |
| 2699 completionHandler:decrementCallbackCounterCount]; | 2682 completionHandler:decrementCallbackCounterCount]; |
| 2700 } | 2683 } |
| 2701 | 2684 |
| 2702 @end | 2685 @end |
| OLD | NEW |