| Index: ios/clean/chrome/browser/ui/tab/tab_container_view_controller.mm
|
| diff --git a/ios/clean/chrome/browser/ui/tab/tab_container_view_controller.mm b/ios/clean/chrome/browser/ui/tab/tab_container_view_controller.mm
|
| index 18df9692b07d3b428f2c6af9a9591de7e72b816f..32f815f918c89944d2b364f16aed98fd1881dee3 100644
|
| --- a/ios/clean/chrome/browser/ui/tab/tab_container_view_controller.mm
|
| +++ b/ios/clean/chrome/browser/ui/tab/tab_container_view_controller.mm
|
| @@ -19,7 +19,8 @@ CGFloat kTabStripHeight = 120.0f;
|
| @interface TabContainerViewController ()
|
|
|
| // Container views for child view controllers. The child view controller's
|
| -// view is added as a subview that fills it's container view via autoresizing.
|
| +// view is added as a subview that fills its container view via autoresizing.
|
| +@property(nonatomic, strong) UIView* findBarView;
|
| @property(nonatomic, strong) UIView* tabStripView;
|
| @property(nonatomic, strong) UIView* toolbarView;
|
| @property(nonatomic, strong) UIView* contentView;
|
| @@ -41,6 +42,8 @@ CGFloat kTabStripHeight = 120.0f;
|
| @implementation TabContainerViewController
|
|
|
| @synthesize contentViewController = _contentViewController;
|
| +@synthesize findBarView = _findBarView;
|
| +@synthesize findBarViewController = _findBarViewController;
|
| @synthesize toolbarViewController = _toolbarViewController;
|
| @synthesize tabStripViewController = _tabStripViewController;
|
| @synthesize tabStripView = _tabStripView;
|
| @@ -55,20 +58,27 @@ CGFloat kTabStripHeight = 120.0f;
|
|
|
| - (void)viewDidLoad {
|
| [super viewDidLoad];
|
| + self.findBarView = [[UIView alloc] init];
|
| self.tabStripView = [[UIView alloc] init];
|
| self.toolbarView = [[UIView alloc] init];
|
| self.contentView = [[UIView alloc] init];
|
| - [self.view addSubview:self.tabStripView];
|
| - [self.view addSubview:self.toolbarView];
|
| - [self.view addSubview:self.contentView];
|
| + self.findBarView.translatesAutoresizingMaskIntoConstraints = NO;
|
| self.tabStripView.translatesAutoresizingMaskIntoConstraints = NO;
|
| self.toolbarView.translatesAutoresizingMaskIntoConstraints = NO;
|
| self.contentView.translatesAutoresizingMaskIntoConstraints = NO;
|
| self.view.backgroundColor = [UIColor blackColor];
|
| + self.findBarView.backgroundColor = [UIColor greenColor];
|
| self.tabStripView.backgroundColor = [UIColor blackColor];
|
| self.toolbarView.backgroundColor = [UIColor blackColor];
|
| self.contentView.backgroundColor = [UIColor blackColor];
|
|
|
| + // Views that are added last have the highest z-order.
|
| + [self.view addSubview:self.tabStripView];
|
| + [self.view addSubview:self.toolbarView];
|
| + [self.view addSubview:self.contentView];
|
| + [self.view addSubview:self.findBarView];
|
| + self.findBarView.hidden = YES;
|
| +
|
| [self addChildViewController:self.tabStripViewController
|
| toSubview:self.tabStripView];
|
| [self addChildViewController:self.toolbarViewController
|
| @@ -100,6 +110,18 @@ CGFloat kTabStripHeight = 120.0f;
|
| _contentViewController = contentViewController;
|
| }
|
|
|
| +- (void)setFindBarViewController:(UIViewController*)findBarViewController {
|
| + if (self.findBarViewController == findBarViewController)
|
| + return;
|
| + if ([self isViewLoaded]) {
|
| + [self detachChildViewController:self.findBarViewController];
|
| + [self addChildViewController:findBarViewController
|
| + toSubview:self.findBarView];
|
| + }
|
| + _findBarViewController = findBarViewController;
|
| + self.findBarView.hidden = (_findBarViewController == nil);
|
| +}
|
| +
|
| - (void)setToolbarViewController:(UIViewController*)toolbarViewController {
|
| if (self.toolbarViewController == toolbarViewController)
|
| return;
|
| @@ -220,7 +242,8 @@ CGFloat kTabStripHeight = 120.0f;
|
| return nil;
|
| }
|
|
|
| -#pragma mark - TabStripActions
|
| +#pragma mark - Action handling
|
| +
|
| - (void)showTabStrip:(id)sender {
|
| self.tabStripHeightConstraint.constant = kTabStripHeight;
|
| // HACK: Remove fake action.
|
| @@ -277,6 +300,15 @@ CGFloat kTabStripHeight = 120.0f;
|
| constraintEqualToAnchor:self.view.trailingAnchor],
|
| [self.contentView.bottomAnchor
|
| constraintEqualToAnchor:self.bottomLayoutGuide.topAnchor],
|
| +
|
| + [self.findBarView.topAnchor
|
| + constraintEqualToAnchor:self.toolbarView.topAnchor],
|
| + [self.findBarView.bottomAnchor
|
| + constraintEqualToAnchor:self.toolbarView.bottomAnchor],
|
| + [self.findBarView.leadingAnchor
|
| + constraintEqualToAnchor:self.toolbarView.leadingAnchor],
|
| + [self.findBarView.trailingAnchor
|
| + constraintEqualToAnchor:self.toolbarView.trailingAnchor],
|
| ];
|
| }
|
|
|
|
|