| Index: ios/clean/chrome/browser/ui/tab_grid/tab_grid_toolbar.mm
|
| diff --git a/ios/clean/chrome/browser/ui/tab_grid/tab_grid_toolbar.mm b/ios/clean/chrome/browser/ui/tab_grid/tab_grid_toolbar.mm
|
| index 8f583b4a2250204f12ba610555a88961efd7487a..db1a3cdbbfccd42ef256096488cc6390918c86be 100644
|
| --- a/ios/clean/chrome/browser/ui/tab_grid/tab_grid_toolbar.mm
|
| +++ b/ios/clean/chrome/browser/ui/tab_grid/tab_grid_toolbar.mm
|
| @@ -4,6 +4,7 @@
|
|
|
| #import "ios/clean/chrome/browser/ui/tab_grid/tab_grid_toolbar.h"
|
|
|
| +#import "base/mac/foundation_util.h"
|
| #import "ios/clean/chrome/browser/ui/tab_grid/ui_stack_view+cr_tab_grid.h"
|
|
|
| #if !defined(__has_feature) || !__has_feature(objc_arc)
|
| @@ -14,8 +15,14 @@ namespace {
|
| const CGFloat kToolbarHeight = 44.0f;
|
| }
|
|
|
| +@interface TabGridToolbar ()
|
| +@property(nonatomic, weak) UIStackView* toolbarContent;
|
| +@end
|
| +
|
| @implementation TabGridToolbar
|
|
|
| +@synthesize toolbarContent = _toolbarContent;
|
| +
|
| - (instancetype)init {
|
| if (self = [super init]) {
|
| UIVisualEffect* blurEffect =
|
| @@ -28,23 +35,32 @@ const CGFloat kToolbarHeight = 44.0f;
|
|
|
| UIStackView* toolbarContent = [UIStackView cr_tabGridToolbarStackView];
|
| [toolbarView.contentView addSubview:toolbarContent];
|
| -
|
| + _toolbarContent = toolbarContent;
|
| // Sets the stackview to a fixed height, anchored to the bottom of the
|
| // blur view.
|
| - toolbarContent.translatesAutoresizingMaskIntoConstraints = NO;
|
| + _toolbarContent.translatesAutoresizingMaskIntoConstraints = NO;
|
| [NSLayoutConstraint activateConstraints:@[
|
| - [toolbarContent.heightAnchor constraintEqualToConstant:kToolbarHeight],
|
| - [toolbarContent.leadingAnchor
|
| + [_toolbarContent.heightAnchor constraintEqualToConstant:kToolbarHeight],
|
| + [_toolbarContent.leadingAnchor
|
| constraintEqualToAnchor:toolbarView.contentView.leadingAnchor],
|
| - [toolbarContent.trailingAnchor
|
| + [_toolbarContent.trailingAnchor
|
| constraintEqualToAnchor:toolbarView.contentView.trailingAnchor],
|
| - [toolbarContent.bottomAnchor
|
| + [_toolbarContent.bottomAnchor
|
| constraintEqualToAnchor:toolbarView.contentView.bottomAnchor]
|
| ]];
|
| }
|
| return self;
|
| }
|
|
|
| +#pragma mark - ZoomTransitionDelegate
|
| +
|
| +- (CGRect)rectForZoomWithKey:(NSObject*)key inView:(UIView*)view {
|
| + UIView* toolsMenuButtonView =
|
| + [self.toolbarContent.arrangedSubviews lastObject];
|
| + return [view convertRect:toolsMenuButtonView.bounds
|
| + fromView:toolsMenuButtonView];
|
| +}
|
| +
|
| #pragma mark - UIView
|
|
|
| // Returns an intrinsic height so that explicit height constraints are
|
|
|