OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "ios/chrome/browser/ui/ui_util.h" | 5 #include "ios/chrome/browser/ui/ui_util.h" |
6 | 6 |
7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #import "ios/chrome/browser/ui/uikit_ui_util.h" | 10 #import "ios/chrome/browser/ui/uikit_ui_util.h" |
11 #include "ui/gfx/ios/uikit_util.h" | 11 #include "ui/gfx/ios/uikit_util.h" |
12 | 12 |
| 13 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 14 #error "This file requires ARC support." |
| 15 #endif |
| 16 |
13 bool IsIPadIdiom() { | 17 bool IsIPadIdiom() { |
14 UIUserInterfaceIdiom idiom = [[UIDevice currentDevice] userInterfaceIdiom]; | 18 UIUserInterfaceIdiom idiom = [[UIDevice currentDevice] userInterfaceIdiom]; |
15 return idiom == UIUserInterfaceIdiomPad; | 19 return idiom == UIUserInterfaceIdiomPad; |
16 } | 20 } |
17 | 21 |
18 const CGFloat kPortraitWidth[INTERFACE_IDIOM_COUNT] = { | 22 const CGFloat kPortraitWidth[INTERFACE_IDIOM_COUNT] = { |
19 320, // IPHONE_IDIOM | 23 320, // IPHONE_IDIOM |
20 768 // IPAD_IDIOM | 24 768 // IPAD_IDIOM |
21 }; | 25 }; |
22 | 26 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 projectTo.size = targetSize; | 148 projectTo.size = targetSize; |
145 break; | 149 break; |
146 } | 150 } |
147 | 151 |
148 projectTo = CGRectIntegral(projectTo); | 152 projectTo = CGRectIntegral(projectTo); |
149 // There's no CGSizeIntegral, faking one instead. | 153 // There's no CGSizeIntegral, faking one instead. |
150 CGRect integralRect = CGRectZero; | 154 CGRect integralRect = CGRectZero; |
151 integralRect.size = targetSize; | 155 integralRect.size = targetSize; |
152 targetSize = CGRectIntegral(integralRect).size; | 156 targetSize = CGRectIntegral(integralRect).size; |
153 } | 157 } |
OLD | NEW |