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/chrome/browser/ui/main/main_view_controller.h" | 5 #import "ios/chrome/browser/ui/main/main_view_controller.h" |
6 | 6 |
7 #import "base/logging.h" | 7 #import "base/logging.h" |
8 | 8 |
| 9 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 10 #error "This file requires ARC support." |
| 11 #endif |
| 12 |
9 @implementation MainViewController | 13 @implementation MainViewController |
10 | 14 |
11 - (UIViewController*)activeViewController { | 15 - (UIViewController*)activeViewController { |
12 return [self.childViewControllers firstObject]; | 16 return [self.childViewControllers firstObject]; |
13 } | 17 } |
14 | 18 |
15 - (void)setActiveViewController:(UIViewController*)activeViewController { | 19 - (void)setActiveViewController:(UIViewController*)activeViewController { |
16 DCHECK(activeViewController); | 20 DCHECK(activeViewController); |
17 if (self.activeViewController == activeViewController) | 21 if (self.activeViewController == activeViewController) |
18 return; | 22 return; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 return self.activeViewController; | 71 return self.activeViewController; |
68 } | 72 } |
69 | 73 |
70 - (BOOL)shouldAutorotate { | 74 - (BOOL)shouldAutorotate { |
71 return self.activeViewController | 75 return self.activeViewController |
72 ? [self.activeViewController shouldAutorotate] | 76 ? [self.activeViewController shouldAutorotate] |
73 : [super shouldAutorotate]; | 77 : [super shouldAutorotate]; |
74 } | 78 } |
75 | 79 |
76 @end | 80 @end |
OLD | NEW |