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

Side by Side Diff: ios/chrome/share_extension/ui_util.mm

Issue 2586713002: Upstream code and resources for Chrome on iOS extensions. (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/share_extension/ui_util.h ('k') | ios/chrome/today_extension/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import <UIKit/UIKit.h>
6
7 #include "ios/chrome/share_extension/ui_util.h"
8
9 #if !defined(__has_feature) || !__has_feature(objc_arc)
10 #error "This file requires ARC support."
11 #endif
12
13 namespace ui_util {
14
15 CGFloat AlignValueToPixel(CGFloat value) {
16 CGFloat scale = [[UIScreen mainScreen] scale];
17 return floor(value * scale) / scale;
18 }
19
20 void ConstrainAllSidesOfViewToView(UIView* container, UIView* filler) {
21 [NSLayoutConstraint activateConstraints:@[
22 [filler.leadingAnchor constraintEqualToAnchor:container.leadingAnchor],
23 [filler.trailingAnchor constraintEqualToAnchor:container.trailingAnchor],
24 [filler.topAnchor constraintEqualToAnchor:container.topAnchor],
25 [filler.bottomAnchor constraintEqualToAnchor:container.bottomAnchor],
26 ]];
27 }
28
29 } // namespace ui_util
OLDNEW
« no previous file with comments | « ios/chrome/share_extension/ui_util.h ('k') | ios/chrome/today_extension/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698