Index: ios/chrome/search_widget_extension/ui_util.mm |
diff --git a/ios/chrome/search_widget_extension/ui_util.mm b/ios/chrome/search_widget_extension/ui_util.mm |
new file mode 100644 |
index 0000000000000000000000000000000000000000..074f1954da63ab2fc1d6fc8e19b8056affbbe8de |
--- /dev/null |
+++ b/ios/chrome/search_widget_extension/ui_util.mm |
@@ -0,0 +1,25 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#import <UIKit/UIKit.h> |
+ |
+#include "ios/chrome/search_widget_extension/ui_util.h" |
+ |
+#if !defined(__has_feature) || !__has_feature(objc_arc) |
+#error "This file requires ARC support." |
+#endif |
+ |
+namespace ui_util { |
+ |
+NSArray<NSLayoutConstraint*>* CreateSameConstraints(UIView* view1, |
+ UIView* view2) { |
+ return @[ |
+ [view1.leadingAnchor constraintEqualToAnchor:view2.leadingAnchor], |
+ [view1.trailingAnchor constraintEqualToAnchor:view2.trailingAnchor], |
+ [view1.topAnchor constraintEqualToAnchor:view2.topAnchor], |
+ [view1.bottomAnchor constraintEqualToAnchor:view2.bottomAnchor] |
+ ]; |
+} |
+ |
+} // namespace ui_util |