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/clean/chrome/browser/ui/overlays/browser_coordinator+overlay_suppor
t.h" |
9 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" | 10 #import "ios/shared/chrome/browser/ui/browser_list/browser.h" |
10 #import "ios/shared/chrome/browser/ui/commands/command_dispatcher.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 viewController = _viewController; | 23 @synthesize viewController = _viewController; |
23 | 24 |
24 #pragma mark - BrowserCoordinator | 25 #pragma mark - BrowserCoordinator |
25 | 26 |
26 - (void)start { | 27 - (void)start { |
27 self.viewController = [SettingsNavigationController | 28 self.viewController = [SettingsNavigationController |
28 newSettingsMainControllerWithMainBrowserState:self.browser | 29 newSettingsMainControllerWithMainBrowserState:self.browser |
29 ->browser_state() | 30 ->browser_state() |
30 currentBrowserState:self.browser | 31 currentBrowserState:self.browser |
31 ->browser_state() | 32 ->browser_state() |
32 delegate:self]; | 33 delegate:self]; |
33 [super start]; | 34 [super start]; |
34 } | 35 } |
35 | 36 |
| 37 - (void)stop { |
| 38 [super stop]; |
| 39 [self overlayWasStopped]; |
| 40 } |
| 41 |
36 #pragma mark - SettingsNavigationControllerDelegate | 42 #pragma mark - SettingsNavigationControllerDelegate |
37 | 43 |
38 - (void)closeSettingsAndOpenUrl:(OpenUrlCommand*)command { | 44 - (void)closeSettingsAndOpenUrl:(OpenUrlCommand*)command { |
39 // Placeholder implementation to conform to the delegate protocol; | 45 // Placeholder implementation to conform to the delegate protocol; |
40 // for now this just closes the settings without opening a URL. | 46 // for now this just closes the settings without opening a URL. |
41 [self closeSettings]; | 47 [self closeSettings]; |
42 } | 48 } |
43 | 49 |
44 - (void)closeSettingsAndOpenNewIncognitoTab { | 50 - (void)closeSettingsAndOpenNewIncognitoTab { |
45 // Placeholder implementation to conform to the delegate protocol; | 51 // Placeholder implementation to conform to the delegate protocol; |
46 // for now this just closes the settings without opening a new tab. | 52 // for now this just closes the settings without opening a new tab. |
47 [self closeSettings]; | 53 [self closeSettings]; |
48 } | 54 } |
49 | 55 |
50 - (void)closeSettings { | 56 - (void)closeSettings { |
51 [static_cast<id>(self.browser->dispatcher()) closeSettings]; | 57 [static_cast<id>(self.browser->dispatcher()) closeSettings]; |
52 } | 58 } |
53 | 59 |
54 @end | 60 @end |
| 61 |
| 62 @implementation SettingsCoordinator (OverlaySupport) |
| 63 |
| 64 - (BOOL)supportsOverlaying { |
| 65 return YES; |
| 66 } |
| 67 |
| 68 @end |
OLD | NEW |