OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 // ====== New Architecture ===== | 5 // ====== New Architecture ===== |
6 // = This code is only used in the new iOS Chrome architecture. = | 6 // = This code is only used in the new iOS Chrome architecture. = |
7 // ============================================================================ | 7 // ============================================================================ |
8 | 8 |
9 #import "ios/clean/chrome/browser/ui/settings/settings_coordinator.h" | 9 #import "ios/clean/chrome/browser/ui/settings/settings_coordinator.h" |
10 | 10 |
11 #import "ios/chrome/browser/ui/settings/settings_navigation_controller.h" | 11 #import "ios/chrome/browser/ui/settings/settings_navigation_controller.h" |
12 #import "ios/clean/chrome/browser/browser_coordinator+internal.h" | 12 #import "ios/clean/chrome/browser/browser_coordinator+internal.h" |
| 13 #import "ios/clean/chrome/browser/model/browser.h" |
13 #import "ios/clean/chrome/browser/ui/commands/settings_commands.h" | 14 #import "ios/clean/chrome/browser/ui/commands/settings_commands.h" |
14 #import "ios/shared/chrome/browser/coordinator_context/coordinator_context.h" | 15 #import "ios/shared/chrome/browser/coordinator_context/coordinator_context.h" |
15 | 16 |
16 #if !defined(__has_feature) || !__has_feature(objc_arc) | 17 #if !defined(__has_feature) || !__has_feature(objc_arc) |
17 #error "This file requires ARC support." | 18 #error "This file requires ARC support." |
18 #endif | 19 #endif |
19 | 20 |
20 @interface SettingsCoordinator ()<SettingsNavigationControllerDelegate> | 21 @interface SettingsCoordinator ()<SettingsNavigationControllerDelegate> |
21 @property(nonatomic, strong) SettingsNavigationController* viewController; | 22 @property(nonatomic, strong) SettingsNavigationController* viewController; |
22 @end | 23 @end |
23 | 24 |
24 @implementation SettingsCoordinator | 25 @implementation SettingsCoordinator |
25 @synthesize settingsCommandHandler = _settingsCommandHandler; | 26 @synthesize settingsCommandHandler = _settingsCommandHandler; |
26 @synthesize viewController = _viewController; | 27 @synthesize viewController = _viewController; |
27 | 28 |
28 #pragma mark - BrowserCoordinator | 29 #pragma mark - BrowserCoordinator |
29 | 30 |
30 - (void)start { | 31 - (void)start { |
31 self.viewController = [SettingsNavigationController | 32 self.viewController = [SettingsNavigationController |
32 newSettingsMainControllerWithMainBrowserState:self.browserState | 33 newSettingsMainControllerWithMainBrowserState:self.browser |
33 currentBrowserState:self.browserState | 34 ->browser_state() |
| 35 currentBrowserState:self.browser |
| 36 ->browser_state() |
34 delegate:self]; | 37 delegate:self]; |
35 [self.context.baseViewController presentViewController:self.viewController | 38 [self.context.baseViewController presentViewController:self.viewController |
36 animated:self.context.animated | 39 animated:self.context.animated |
37 completion:nil]; | 40 completion:nil]; |
38 } | 41 } |
39 | 42 |
40 - (void)stop { | 43 - (void)stop { |
41 [self.viewController.presentingViewController | 44 [self.viewController.presentingViewController |
42 dismissViewControllerAnimated:self.context.animated | 45 dismissViewControllerAnimated:self.context.animated |
43 completion:nil]; | 46 completion:nil]; |
(...skipping 11 matching lines...) Expand all Loading... |
55 // Placeholder implementation to conform to the delegate protocol; | 58 // Placeholder implementation to conform to the delegate protocol; |
56 // for now this just closes the settings without opening a new tab. | 59 // for now this just closes the settings without opening a new tab. |
57 [self closeSettings]; | 60 [self closeSettings]; |
58 } | 61 } |
59 | 62 |
60 - (void)closeSettings { | 63 - (void)closeSettings { |
61 [self.settingsCommandHandler closeSettings]; | 64 [self.settingsCommandHandler closeSettings]; |
62 } | 65 } |
63 | 66 |
64 @end | 67 @end |
OLD | NEW |