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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: ios/clean/chrome/browser/ui/omnibox/location_bar_view_controller.mm
diff --git a/ios/clean/chrome/browser/ui/omnibox/location_bar_view_controller.mm b/ios/clean/chrome/browser/ui/omnibox/location_bar_view_controller.mm
new file mode 100644
index 0000000000000000000000000000000000000000..395bcfb3a86c72d54da4af7411a1cb8e03b5e8ff
--- /dev/null
+++ b/ios/clean/chrome/browser/ui/omnibox/location_bar_view_controller.mm
@@ -0,0 +1,44 @@
+// 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 "ios/clean/chrome/browser/ui/omnibox/location_bar_view_controller.h"
+
+#import "ios/chrome/browser/ui/omnibox/omnibox_text_field_ios.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+@interface LocationBarViewController ()
+@property(nonatomic, readwrite, strong) OmniboxTextFieldIOS* omnibox;
+@end
+
+@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 =)
+}
+
+@synthesize omnibox = _omnibox;
+
+- (instancetype)init {
+ if ((self = [super init])) {
+ UIColor* textColor = [UIColor blackColor];
+ UIColor* tintColor = nil;
+ 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
+ [[OmniboxTextFieldIOS alloc] initWithFrame:CGRectZero
+ font:[UIFont systemFontOfSize:14]
+ textColor:textColor
+ tintColor:tintColor];
+ }
+ return self;
+}
+
+- (void)loadView {
+ self.view = [[UIView alloc] initWithFrame:CGRectZero];
+ 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.
+ self.omnibox.autoresizingMask =
+ UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+ self.omnibox.frame = self.view.bounds;
+ [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.
+}
+
+@end

Powered by Google App Engine
This is Rietveld 408576698