Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: ios/chrome/browser/ui/UIView+SizeClassSupport.mm

Issue 2569213002: [ObjC ARC] Reland of Converts ios/chrome/browser/ui:ui to ARC. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/ui/BUILD.gn ('k') | ios/chrome/browser/ui/animation_util.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/UIView+SizeClassSupport.h" 5 #import "ios/chrome/browser/ui/UIView+SizeClassSupport.h"
6 6
7 #import "base/logging.h" 7 #import "base/logging.h"
8 #import "base/ios/ios_util.h" 8 #import "base/ios/ios_util.h"
9 #import "ios/chrome/browser/ui/ui_util.h" 9 #import "ios/chrome/browser/ui/ui_util.h"
10 10
11 #if !defined(__has_feature) || !__has_feature(objc_arc)
12 #error "This file requires ARC support."
13 #endif
14
11 namespace { 15 namespace {
12 16
13 // Returns the SizeClassIdiom corresponding with |size_class|. 17 // Returns the SizeClassIdiom corresponding with |size_class|.
14 SizeClassIdiom GetSizeClassIdiom(UIUserInterfaceSizeClass size_class) { 18 SizeClassIdiom GetSizeClassIdiom(UIUserInterfaceSizeClass size_class) {
15 switch (size_class) { 19 switch (size_class) {
16 case UIUserInterfaceSizeClassCompact: 20 case UIUserInterfaceSizeClassCompact:
17 return COMPACT; 21 return COMPACT;
18 case UIUserInterfaceSizeClassRegular: 22 case UIUserInterfaceSizeClassRegular:
19 return REGULAR; 23 return REGULAR;
20 case UIUserInterfaceSizeClassUnspecified: 24 case UIUserInterfaceSizeClassUnspecified:
(...skipping 20 matching lines...) Expand all
41 45
42 - (SizeClassIdiom)cr_heightSizeClass { 46 - (SizeClassIdiom)cr_heightSizeClass {
43 UIWindow* keyWindow = [UIApplication sharedApplication].keyWindow; 47 UIWindow* keyWindow = [UIApplication sharedApplication].keyWindow;
44 UIUserInterfaceSizeClass sizeClass = self.traitCollection.verticalSizeClass; 48 UIUserInterfaceSizeClass sizeClass = self.traitCollection.verticalSizeClass;
45 if (!IsSizeClassSpecified(sizeClass)) 49 if (!IsSizeClassSpecified(sizeClass))
46 sizeClass = keyWindow.traitCollection.verticalSizeClass; 50 sizeClass = keyWindow.traitCollection.verticalSizeClass;
47 return GetSizeClassIdiom(sizeClass); 51 return GetSizeClassIdiom(sizeClass);
48 } 52 }
49 53
50 @end 54 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/BUILD.gn ('k') | ios/chrome/browser/ui/animation_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698