OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/orientation_limiting_navigation_controller.h" | 5 #import "ios/chrome/browser/ui/orientation_limiting_navigation_controller.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ios/chrome/browser/ui/ui_util.h" | 8 #include "ios/chrome/browser/ui/ui_util.h" |
9 | 9 |
| 10 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 11 #error "This file requires ARC support." |
| 12 #endif |
| 13 |
10 @implementation OrientationLimitingNavigationController | 14 @implementation OrientationLimitingNavigationController |
11 | 15 |
12 - (NSUInteger)supportedInterfaceOrientations { | 16 - (NSUInteger)supportedInterfaceOrientations { |
13 return IsIPadIdiom() ? [super supportedInterfaceOrientations] | 17 return IsIPadIdiom() ? [super supportedInterfaceOrientations] |
14 : UIInterfaceOrientationMaskPortrait; | 18 : UIInterfaceOrientationMaskPortrait; |
15 } | 19 } |
16 | 20 |
17 - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { | 21 - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { |
18 return IsIPadIdiom() ? [super preferredInterfaceOrientationForPresentation] | 22 return IsIPadIdiom() ? [super preferredInterfaceOrientationForPresentation] |
19 : UIInterfaceOrientationPortrait; | 23 : UIInterfaceOrientationPortrait; |
20 } | 24 } |
21 | 25 |
22 - (BOOL)shouldAutorotate { | 26 - (BOOL)shouldAutorotate { |
23 return IsIPadIdiom() ? [super shouldAutorotate] : NO; | 27 return IsIPadIdiom() ? [super shouldAutorotate] : NO; |
24 } | 28 } |
25 | 29 |
26 @end | 30 @end |
OLD | NEW |