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 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 6 #error "This file requires ARC support." |
| 7 #endif |
| 8 |
| 9 #import "remoting/ios/app/panel_view_controller_chromium.h" |
| 10 |
| 11 #include "base/logging.h" |
| 12 |
| 13 #import "remoting/ios/app/remoting_menu_view_controller.h" |
| 14 |
| 15 @interface PanelViewControllerChromium () { |
| 16 RemotingMenuViewController* _menuController; |
| 17 UIViewController* _mainViewController; |
| 18 } |
| 19 @end |
| 20 |
| 21 @implementation PanelViewControllerChromium |
| 22 |
| 23 - (instancetype)init { |
| 24 if (self = [super init]) { |
| 25 _menuController = [[RemotingMenuViewController alloc] init]; |
| 26 } |
| 27 return self; |
| 28 } |
| 29 |
| 30 - (void)setPanelHidden:(BOOL)hidden animated:(BOOL)animated { |
| 31 if (!hidden) { |
| 32 [self presentViewController:_menuController |
| 33 animated:animated |
| 34 completion:nil]; |
| 35 } |
| 36 } |
| 37 |
| 38 - (void)setMainViewController:(UIViewController*)mainViewController { |
| 39 _mainViewController = mainViewController; |
| 40 [self addChildViewController:_mainViewController]; |
| 41 [self.view addSubview:_mainViewController.view]; |
| 42 [_mainViewController didMoveToParentViewController:self]; |
| 43 } |
| 44 |
| 45 - (UIViewController*)mainViewController { |
| 46 return _mainViewController; |
| 47 } |
| 48 |
| 49 - (UIViewController*)childViewControllerForStatusBarStyle { |
| 50 return _mainViewController; |
| 51 } |
| 52 |
| 53 - (UIViewController*)childViewControllerForStatusBarHidden { |
| 54 return _mainViewController; |
| 55 } |
| 56 |
| 57 @end |
OLD | NEW |