| 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 | |
| 14 @implementation OrientationLimitingNavigationController | 10 @implementation OrientationLimitingNavigationController |
| 15 | 11 |
| 16 - (NSUInteger)supportedInterfaceOrientations { | 12 - (NSUInteger)supportedInterfaceOrientations { |
| 17 return IsIPadIdiom() ? [super supportedInterfaceOrientations] | 13 return IsIPadIdiom() ? [super supportedInterfaceOrientations] |
| 18 : UIInterfaceOrientationMaskPortrait; | 14 : UIInterfaceOrientationMaskPortrait; |
| 19 } | 15 } |
| 20 | 16 |
| 21 - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { | 17 - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { |
| 22 return IsIPadIdiom() ? [super preferredInterfaceOrientationForPresentation] | 18 return IsIPadIdiom() ? [super preferredInterfaceOrientationForPresentation] |
| 23 : UIInterfaceOrientationPortrait; | 19 : UIInterfaceOrientationPortrait; |
| 24 } | 20 } |
| 25 | 21 |
| 26 - (BOOL)shouldAutorotate { | 22 - (BOOL)shouldAutorotate { |
| 27 return IsIPadIdiom() ? [super shouldAutorotate] : NO; | 23 return IsIPadIdiom() ? [super shouldAutorotate] : NO; |
| 28 } | 24 } |
| 29 | 25 |
| 30 @end | 26 @end |
| OLD | NEW |