OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "ios/chrome/browser/ui/main/main_coordinator.h" |
| 6 |
| 7 #include "base/ios/weak_nsobject.h" |
| 8 #include "base/mac/scoped_nsobject.h" |
| 9 #import "ios/chrome/browser/ui/main/main_view_controller.h" |
| 10 |
| 11 @interface MainCoordinator () { |
| 12 // Instance variables backing properties of the same name. |
| 13 // |_mainViewController| will be owned by |self.window|. |
| 14 base::WeakNSObject<MainViewController> _mainViewController; |
| 15 } |
| 16 |
| 17 @end |
| 18 |
| 19 @implementation MainCoordinator |
| 20 |
| 21 #pragma mark - property implementation. |
| 22 |
| 23 - (MainViewController*)mainViewController { |
| 24 return _mainViewController; |
| 25 } |
| 26 |
| 27 #pragma mark - ChromeCoordinator implementation. |
| 28 |
| 29 - (void)start { |
| 30 base::scoped_nsobject<MainViewController> mainViewController( |
| 31 [[MainViewController alloc] init]); |
| 32 _mainViewController.reset(mainViewController); |
| 33 self.window.rootViewController = self.mainViewController; |
| 34 |
| 35 // Size the main view controller to fit the whole screen. |
| 36 [self.mainViewController.view setFrame:self.window.bounds]; |
| 37 } |
| 38 |
| 39 @end |
OLD | NEW |