| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/uikit_ui_util.h" | 5 #import "ios/chrome/browser/ui/uikit_ui_util.h" |
| 6 | 6 |
| 7 #import <Accelerate/Accelerate.h> | 7 #import <Accelerate/Accelerate.h> |
| 8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 9 #import <QuartzCore/QuartzCore.h> | 9 #import <QuartzCore/QuartzCore.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 [view1.centerYAnchor constraintEqualToAnchor:view2.centerYAnchor].active = | 630 [view1.centerYAnchor constraintEqualToAnchor:view2.centerYAnchor].active = |
| 631 YES; | 631 YES; |
| 632 } | 632 } |
| 633 | 633 |
| 634 void AddSameCenterYConstraint(UIView* unused_parentView, | 634 void AddSameCenterYConstraint(UIView* unused_parentView, |
| 635 UIView* subview1, | 635 UIView* subview1, |
| 636 UIView* subview2) { | 636 UIView* subview2) { |
| 637 AddSameCenterYConstraint(subview1, subview2); | 637 AddSameCenterYConstraint(subview1, subview2); |
| 638 } | 638 } |
| 639 | 639 |
| 640 void AddSameSizeConstraint(UIView* view1, UIView* view2) { | 640 void AddSameConstraints(UIView* view1, UIView* view2) { |
| 641 [NSLayoutConstraint activateConstraints:@[ | 641 [NSLayoutConstraint activateConstraints:@[ |
| 642 [view1.leadingAnchor constraintEqualToAnchor:view2.leadingAnchor], | 642 [view1.leadingAnchor constraintEqualToAnchor:view2.leadingAnchor], |
| 643 [view1.trailingAnchor constraintEqualToAnchor:view2.trailingAnchor], | 643 [view1.trailingAnchor constraintEqualToAnchor:view2.trailingAnchor], |
| 644 [view1.topAnchor constraintEqualToAnchor:view2.topAnchor], | 644 [view1.topAnchor constraintEqualToAnchor:view2.topAnchor], |
| 645 [view1.bottomAnchor constraintEqualToAnchor:view2.bottomAnchor] | 645 [view1.bottomAnchor constraintEqualToAnchor:view2.bottomAnchor] |
| 646 ]]; | 646 ]]; |
| 647 } | 647 } |
| 648 | 648 |
| 649 bool IsCompact(id<UITraitEnvironment> environment) { | 649 bool IsCompact(id<UITraitEnvironment> environment) { |
| 650 return environment.traitCollection.horizontalSizeClass == | 650 return environment.traitCollection.horizontalSizeClass == |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 | 700 |
| 701 // On iOS10 and above, trigger a haptic vibration for a notification. | 701 // On iOS10 and above, trigger a haptic vibration for a notification. |
| 702 // This is a no-op for devices that do not support it. | 702 // This is a no-op for devices that do not support it. |
| 703 void TriggerHapticFeedbackForNotification(UINotificationFeedbackType type) { | 703 void TriggerHapticFeedbackForNotification(UINotificationFeedbackType type) { |
| 704 if (base::ios::IsRunningOnIOS10OrLater()) { | 704 if (base::ios::IsRunningOnIOS10OrLater()) { |
| 705 UINotificationFeedbackGenerator* generator = | 705 UINotificationFeedbackGenerator* generator = |
| 706 [[UINotificationFeedbackGenerator alloc] init]; | 706 [[UINotificationFeedbackGenerator alloc] init]; |
| 707 [generator notificationOccurred:type]; | 707 [generator notificationOccurred:type]; |
| 708 } | 708 } |
| 709 } | 709 } |
| OLD | NEW |