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/toolbar/toolbar_coordinator.h" | 9 #import "ios/clean/chrome/browser/ui/toolbar/toolbar_coordinator.h" |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 - (void)start { | 46 - (void)start { |
47 self.viewController = [[ToolbarViewController alloc] init]; | 47 self.viewController = [[ToolbarViewController alloc] init]; |
48 self.viewController.toolbarCommandHandler = self; | 48 self.viewController.toolbarCommandHandler = self; |
49 self.mediator.consumer = self.viewController; | 49 self.mediator.consumer = self.viewController; |
50 | 50 |
51 [self.context.baseViewController presentViewController:self.viewController | 51 [self.context.baseViewController presentViewController:self.viewController |
52 animated:self.context.animated | 52 animated:self.context.animated |
53 completion:nil]; | 53 completion:nil]; |
| 54 [super start]; |
54 } | 55 } |
55 | 56 |
56 #pragma mark - ToolbarCommands | 57 #pragma mark - ToolbarCommands |
57 | 58 |
58 - (void)showToolsMenu { | 59 - (void)showToolsMenu { |
59 ToolsCoordinator* toolsCoordinator = [[ToolsCoordinator alloc] init]; | 60 ToolsCoordinator* toolsCoordinator = [[ToolsCoordinator alloc] init]; |
60 toolsCoordinator.toolbarCommandHandler = self; | 61 toolsCoordinator.toolbarCommandHandler = self; |
61 [self addChildCoordinator:toolsCoordinator]; | 62 [self addChildCoordinator:toolsCoordinator]; |
62 [toolsCoordinator start]; | 63 [toolsCoordinator start]; |
63 self.toolsMenuCoordinator = toolsCoordinator; | 64 self.toolsMenuCoordinator = toolsCoordinator; |
64 } | 65 } |
65 | 66 |
66 - (void)closeToolsMenu { | 67 - (void)closeToolsMenu { |
67 [self.toolsMenuCoordinator stop]; | 68 [self.toolsMenuCoordinator stop]; |
68 [self removeChildCoordinator:self.toolsMenuCoordinator]; | 69 [self removeChildCoordinator:self.toolsMenuCoordinator]; |
69 } | 70 } |
70 | 71 |
71 @end | 72 @end |
OLD | NEW |