| Code-Review | +1 |
LGTM w/ some nits. Have you tested how the banner looks when resizing an iPad window?
"+ios/chrome/browser/banner_promo/model/default_browser_banner_promo_app_agent.h",I think best practice is to include `model/` instead of the specific header?
if (topPosition && !self.profile->IsOffTheRecord()) {This is accessed a couple times in this method. Consider creating a variable to reuse.
@interface ToolbarMediator : NSObject <ToolbarMutator, BannerPromoViewDelegate>nit: Alphabetical order
@protocol BannerPromoViewDelegate;nit: Alphabetical order.
// Constraints for the banner promo in split toolbar mode.
NSArray<NSLayoutConstraint*>* _bannerPromoAboveConstraints;
// Constraints for the banner promo in non-split toolbar mode.
NSArray<NSLayoutConstraint*>* _bannerPromoBelowConstraints;Can you specify in the comments that in split toolbar mode the banner is above the toolbar and vice versa?
// Helper method to actually do the animation to show the banner promo.
- (void)showBannerPromoAnimationBlock {
_bannerPromoBackgroundHeightConstraint.constant =
[self bannerPromoBackgroundHeightForFullscreenProgress:1];
_locationBarBottomPaddingConstraint.constant =
-[self locationBarBottomPaddingForFullscreenProgress:_fullscreenProgress];
[self.toolbarHeightDelegate toolbarsHeightChanged];
[self.view.superview layoutIfNeeded];
}
// Helper method for show completion.
- (void)showBannerPromoCompletionBlock {
UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification,
_bannerPromo);
}Consider moving under private pragma
// Helper method to actually do the animation to hide the banner promo.
- (void)hideBannerPromoAnimationBlock {
if ([self isBannerBelowToolbar]) {
_bannerPromoBackgroundHeightConstraint.constant = 0;
} else {
_bannerPromoBackgroundTopConstraint.constant =
-[self bannerPromoBackgroundHeightForFullscreenProgress:1];
}
_bannerPromoVisible = NO;
_locationBarBottomPaddingConstraint.constant =
-[self locationBarBottomPaddingForFullscreenProgress:_fullscreenProgress];
[self.toolbarHeightDelegate toolbarsHeightChanged];
[self.view.superview layoutIfNeeded];
}
// Helper method for hide completion.
- (void)hideBannerPromoCompletionBlock {
[NSLayoutConstraint deactivateConstraints:_bannerPromoAboveConstraints];
[NSLayoutConstraint deactivateConstraints:_bannerPromoBelowConstraints];
[self.view.superview layoutIfNeeded];
}Same as above.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |