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/settings/settings_navigation_controller.h" |
| 13 |
| 14 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 15 #error "This file requires ARC support." |
| 16 #endif |
| 17 |
| 18 @interface SettingsCoordinator ()<SettingsNavigationControllerDelegate> |
| 19 @property(nonatomic, strong) SettingsNavigationController* viewController; |
| 20 @end |
| 21 |
| 22 @implementation SettingsCoordinator |
| 23 @synthesize actionDelegate = _actionDelegate; |
| 24 @synthesize viewController = _viewController; |
| 25 |
| 26 #pragma mark - BrowserCoordinator |
| 27 |
| 28 - (void)start { |
| 29 self.viewController = [SettingsNavigationController |
| 30 newSettingsMainControllerWithMainBrowserState:self.browserState |
| 31 currentBrowserState:self.browserState |
| 32 delegate:self]; |
| 33 [self.rootViewController presentViewController:self.viewController |
| 34 animated:YES |
| 35 completion:nil]; |
| 36 } |
| 37 |
| 38 - (void)stop { |
| 39 [self.viewController dismissViewControllerAnimated:YES completion:nil]; |
| 40 } |
| 41 |
| 42 #pragma mark - SettingsNavigationControllerDelegate |
| 43 |
| 44 - (void)closeSettingsAndOpenUrl:(OpenUrlCommand*)command { |
| 45 // Placeholder implementation to conform to the delegate protocol; |
| 46 // for now this just closes the settings without opening a URL. |
| 47 [self closeSettings]; |
| 48 } |
| 49 |
| 50 - (void)closeSettingsAndOpenNewIncognitoTab { |
| 51 // Placeholder implementation to conform to the delegate protocol; |
| 52 // for now this just closes the settings without opening a new tab. |
| 53 [self closeSettings]; |
| 54 } |
| 55 |
| 56 - (void)closeSettings { |
| 57 [self.actionDelegate closeSettings]; |
| 58 } |
| 59 |
| 60 @end |
OLD | NEW |