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 #import "ios/clean/chrome/browser/ui/settings/settings_coordinator.h" | 5 #import "ios/clean/chrome/browser/ui/settings/settings_coordinator.h" |
6 | 6 |
7 #import "ios/chrome/browser/ui/settings/settings_navigation_controller.h" | 7 #import "ios/chrome/browser/ui/settings/settings_navigation_controller.h" |
8 #import "ios/clean/chrome/browser/ui/commands/settings_commands.h" | 8 #import "ios/clean/chrome/browser/ui/commands/settings_commands.h" |
9 #import "ios/shared/chrome/browser/coordinator_context/coordinator_context.h" | 9 #import "ios/shared/chrome/browser/coordinator_context/coordinator_context.h" |
10 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" | 10 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" |
| 11 #import "ios/shared/chrome/browser/ui/commands/command_dispatcher.h" |
11 #import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal.
h" | 12 #import "ios/shared/chrome/browser/ui/coordinators/browser_coordinator+internal.
h" |
12 | 13 |
13 #if !defined(__has_feature) || !__has_feature(objc_arc) | 14 #if !defined(__has_feature) || !__has_feature(objc_arc) |
14 #error "This file requires ARC support." | 15 #error "This file requires ARC support." |
15 #endif | 16 #endif |
16 | 17 |
17 @interface SettingsCoordinator ()<SettingsNavigationControllerDelegate> | 18 @interface SettingsCoordinator ()<SettingsNavigationControllerDelegate> |
18 @property(nonatomic, strong) SettingsNavigationController* viewController; | 19 @property(nonatomic, strong) SettingsNavigationController* viewController; |
19 @end | 20 @end |
20 | 21 |
21 @implementation SettingsCoordinator | 22 @implementation SettingsCoordinator |
22 @synthesize settingsCommandHandler = _settingsCommandHandler; | |
23 @synthesize viewController = _viewController; | 23 @synthesize viewController = _viewController; |
24 | 24 |
25 #pragma mark - BrowserCoordinator | 25 #pragma mark - BrowserCoordinator |
26 | 26 |
27 - (void)start { | 27 - (void)start { |
28 self.viewController = [SettingsNavigationController | 28 self.viewController = [SettingsNavigationController |
29 newSettingsMainControllerWithMainBrowserState:self.browser | 29 newSettingsMainControllerWithMainBrowserState:self.browser |
30 ->browser_state() | 30 ->browser_state() |
31 currentBrowserState:self.browser | 31 currentBrowserState:self.browser |
32 ->browser_state() | 32 ->browser_state() |
(...skipping 19 matching lines...) Expand all Loading... |
52 [self closeSettings]; | 52 [self closeSettings]; |
53 } | 53 } |
54 | 54 |
55 - (void)closeSettingsAndOpenNewIncognitoTab { | 55 - (void)closeSettingsAndOpenNewIncognitoTab { |
56 // Placeholder implementation to conform to the delegate protocol; | 56 // Placeholder implementation to conform to the delegate protocol; |
57 // for now this just closes the settings without opening a new tab. | 57 // for now this just closes the settings without opening a new tab. |
58 [self closeSettings]; | 58 [self closeSettings]; |
59 } | 59 } |
60 | 60 |
61 - (void)closeSettings { | 61 - (void)closeSettings { |
62 [self.settingsCommandHandler closeSettings]; | 62 [static_cast<id>(self.browser->dispatcher()) closeSettings]; |
63 } | 63 } |
64 | 64 |
65 @end | 65 @end |
OLD | NEW |