| 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 | |
| 17 bool IsIPadIdiom() { | 13 bool IsIPadIdiom() { |
| 18 UIUserInterfaceIdiom idiom = [[UIDevice currentDevice] userInterfaceIdiom]; | 14 UIUserInterfaceIdiom idiom = [[UIDevice currentDevice] userInterfaceIdiom]; |
| 19 return idiom == UIUserInterfaceIdiomPad; | 15 return idiom == UIUserInterfaceIdiomPad; |
| 20 } | 16 } |
| 21 | 17 |
| 22 const CGFloat kPortraitWidth[INTERFACE_IDIOM_COUNT] = { | 18 const CGFloat kPortraitWidth[INTERFACE_IDIOM_COUNT] = { |
| 23 320, // IPHONE_IDIOM | 19 320, // IPHONE_IDIOM |
| 24 768 // IPAD_IDIOM | 20 768 // IPAD_IDIOM |
| 25 }; | 21 }; |
| 26 | 22 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 projectTo.size = targetSize; | 144 projectTo.size = targetSize; |
| 149 break; | 145 break; |
| 150 } | 146 } |
| 151 | 147 |
| 152 projectTo = CGRectIntegral(projectTo); | 148 projectTo = CGRectIntegral(projectTo); |
| 153 // There's no CGSizeIntegral, faking one instead. | 149 // There's no CGSizeIntegral, faking one instead. |
| 154 CGRect integralRect = CGRectZero; | 150 CGRect integralRect = CGRectZero; |
| 155 integralRect.size = targetSize; | 151 integralRect.size = targetSize; |
| 156 targetSize = CGRectIntegral(integralRect).size; | 152 targetSize = CGRectIntegral(integralRect).size; |
| 157 } | 153 } |
| OLD | NEW |