Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: ios/clean/chrome/browser/ui/settings/settings_coordinator.mm

Issue 2779213003: [clean] Use CommandDispatcher to show/close Settings. (Closed)
Patch Set: Fix tests Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ios/clean/chrome/browser/ui/settings/settings_coordinator.h ('k') | ios/clean/chrome/browser/ui/tab_grid/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698