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

Side by Side Diff: ios/clean/chrome/browser/ui/omnibox/location_bar_view_controller.mm

Issue 2761343002: [ios] Adds LocationBarCoordinator. (Closed)
Patch Set: Rebased. Created 3 years, 8 months 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
OLDNEW
(Empty)
1 // Copyright 2017 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 "ios/clean/chrome/browser/ui/omnibox/location_bar_view_controller.h"
6
7 #import "ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h"
8
9 #if !defined(__has_feature) || !__has_feature(objc_arc)
10 #error "This file requires ARC support."
11 #endif
12
13 @interface LocationBarViewController ()
14 @property(nonatomic, readwrite, strong) OmniboxTextFieldIOS* omnibox;
15 @end
16
17 @implementation LocationBarViewController {
marq (ping after 24h) 2017/04/05 09:07:19 Spurious {}
rohitrao (ping after 24h) 2017/04/05 14:37:05 I was expecting to need them for something =)
18 }
19
20 @synthesize omnibox = _omnibox;
21
22 - (instancetype)init {
23 if ((self = [super init])) {
24 UIColor* textColor = [UIColor blackColor];
25 UIColor* tintColor = nil;
26 self.omnibox =
marq (ping after 24h) 2017/04/05 09:07:19 Don't assign to properties in the init; use _omnib
rohitrao (ping after 24h) 2017/04/05 14:37:05 Done. We are not consistent about this in ios/cle
marq (ping after 24h) 2017/04/05 14:59:10 We should be consistent with this. I'll do a clean
27 [[OmniboxTextFieldIOS alloc] initWithFrame:CGRectZero
28 font:[UIFont systemFontOfSize:14]
29 textColor:textColor
30 tintColor:tintColor];
31 }
32 return self;
33 }
34
35 - (void)loadView {
36 self.view = [[UIView alloc] initWithFrame:CGRectZero];
37 self.omnibox.translatesAutoresizingMaskIntoConstraints = YES;
marq (ping after 24h) 2017/04/05 09:07:19 YES is the default, so no need for this (unless it
rohitrao (ping after 24h) 2017/04/05 14:37:05 Done.
38 self.omnibox.autoresizingMask =
39 UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
40 self.omnibox.frame = self.view.bounds;
41 [self.view addSubview:self.omnibox];
marq (ping after 24h) 2017/04/05 09:07:19 Why do this in -loadView and not -viewDidLoad ?
rohitrao (ping after 24h) 2017/04/05 14:37:05 Moved.
42 }
43
44 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698