| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // ====== New Architecture ===== | |
| 6 // = This code is only used in the new iOS Chrome architecture. = | |
| 7 // ============================================================================ | |
| 8 | |
| 9 #import "ios/chrome/browser/ui/settings/settings_coordinator.h" | |
| 10 | |
| 11 #import "ios/chrome/browser/browser_coordinator+internal.h" | |
| 12 #import "ios/chrome/browser/ui/commands/settings_commands.h" | |
| 13 #import "ios/chrome/browser/ui/settings/settings_navigation_controller.h" | |
| 14 | |
| 15 #if !defined(__has_feature) || !__has_feature(objc_arc) | |
| 16 #error "This file requires ARC support." | |
| 17 #endif | |
| 18 | |
| 19 @interface SettingsCoordinator ()<SettingsNavigationControllerDelegate> | |
| 20 @property(nonatomic, strong) SettingsNavigationController* viewController; | |
| 21 @end | |
| 22 | |
| 23 @implementation SettingsCoordinator | |
| 24 @synthesize settingsCommandHandler = _settingsCommandHandler; | |
| 25 @synthesize viewController = _viewController; | |
| 26 | |
| 27 #pragma mark - BrowserCoordinator | |
| 28 | |
| 29 - (void)start { | |
| 30 self.viewController = [SettingsNavigationController | |
| 31 newSettingsMainControllerWithMainBrowserState:self.browserState | |
| 32 currentBrowserState:self.browserState | |
| 33 delegate:self]; | |
| 34 [self.rootViewController presentViewController:self.viewController | |
| 35 animated:YES | |
| 36 completion:nil]; | |
| 37 } | |
| 38 | |
| 39 - (void)stop { | |
| 40 [self.viewController dismissViewControllerAnimated:YES completion:nil]; | |
| 41 } | |
| 42 | |
| 43 #pragma mark - SettingsNavigationControllerDelegate | |
| 44 | |
| 45 - (void)closeSettingsAndOpenUrl:(OpenUrlCommand*)command { | |
| 46 // Placeholder implementation to conform to the delegate protocol; | |
| 47 // for now this just closes the settings without opening a URL. | |
| 48 [self closeSettings]; | |
| 49 } | |
| 50 | |
| 51 - (void)closeSettingsAndOpenNewIncognitoTab { | |
| 52 // Placeholder implementation to conform to the delegate protocol; | |
| 53 // for now this just closes the settings without opening a new tab. | |
| 54 [self closeSettings]; | |
| 55 } | |
| 56 | |
| 57 - (void)closeSettings { | |
| 58 [self.settingsCommandHandler closeSettings]; | |
| 59 } | |
| 60 | |
| 61 @end | |
| OLD | NEW |