Commit ed44ca7a authored by sczs's avatar sczs Committed by Commit Bot

[ios] Deletes Infobar Sizing Delegates

Before this CL Infobar.cc was informing InfobarContainer of an InfobarView
resize. Also, the InfobarView was being set by Infobar.cc it now sets its
own height.

This CL:
- Adds functionality so InfobarContainer resizing is driven by UiKit.
- Deletes InfobarViewSizing and InfobarViewSizingDelegate.
- Removes the plumbing from InfobarView that informs Infobar.cc of a
resize.
- Removes InfobarIOS and InfobarController methods that were used to
resize the InfobarView.

Bug: 892376
Change-Id: Iaae3c0ec36ce226fc89fb405cb3d9c40376d3a79
Reviewed-on: https://chromium-review.googlesource.com/c/1321849
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606589}
parent d27bb543
...@@ -55,7 +55,7 @@ typedef NS_ENUM(NSInteger, ConfirmInfoBarUITags) { ...@@ -55,7 +55,7 @@ typedef NS_ENUM(NSInteger, ConfirmInfoBarUITags) {
return [super initWithInfoBarDelegate:infoBarDelegate]; return [super initWithInfoBarDelegate:infoBarDelegate];
} }
- (UIView<InfoBarViewSizing>*)infobarView { - (UIView*)infobarView {
ConfirmInfoBarView* infoBarView = ConfirmInfoBarView* infoBarView =
[[ConfirmInfoBarView alloc] initWithFrame:CGRectZero]; [[ConfirmInfoBarView alloc] initWithFrame:CGRectZero];
_infoBarView = infoBarView; _infoBarView = infoBarView;
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
#ifndef IOS_CHROME_BROWSER_INFOBARS_INFOBAR_H_ #ifndef IOS_CHROME_BROWSER_INFOBARS_INFOBAR_H_
#define IOS_CHROME_BROWSER_INFOBARS_INFOBAR_H_ #define IOS_CHROME_BROWSER_INFOBARS_INFOBAR_H_
#import <UIKit/UIKit.h>
#include <memory> #include <memory>
#include "base/macros.h" #include "base/macros.h"
#include "components/infobars/core/infobar.h" #include "components/infobars/core/infobar.h"
#import "ios/chrome/browser/infobars/infobar_controller_delegate.h" #import "ios/chrome/browser/infobars/infobar_controller_delegate.h"
#import "ios/chrome/browser/ui/infobars/infobar_view_sizing.h"
@class InfoBarController; @class InfoBarController;
namespace infobars { namespace infobars {
...@@ -25,17 +25,13 @@ class InfoBarIOS : public infobars::InfoBar, public InfoBarControllerDelegate { ...@@ -25,17 +25,13 @@ class InfoBarIOS : public infobars::InfoBar, public InfoBarControllerDelegate {
~InfoBarIOS() override; ~InfoBarIOS() override;
// Returns the infobar view holding contents of this infobar. // Returns the infobar view holding contents of this infobar.
UIView<InfoBarViewSizing>* view(); UIView* view();
// Remove the infobar view from infobar container view. // Remove the infobar view from infobar container view.
void RemoveView(); void RemoveView();
private: private:
// infobars::InfoBar overrides:
void PlatformSpecificOnHeightRecalculated() override;
// InfoBarControllerDelegate overrides: // InfoBarControllerDelegate overrides:
void SetInfoBarTargetHeight(int height) override;
bool IsOwned() override; bool IsOwned() override;
void RemoveInfoBar() override; void RemoveInfoBar() override;
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#import "ios/chrome/browser/infobars/confirm_infobar_controller.h" #import "ios/chrome/browser/infobars/confirm_infobar_controller.h"
#include "ios/chrome/browser/infobars/infobar_controller.h" #include "ios/chrome/browser/infobars/infobar_controller.h"
#include "ios/chrome/browser/translate/translate_infobar_tags.h" #include "ios/chrome/browser/translate/translate_infobar_tags.h"
#import "ios/chrome/browser/ui/infobars/infobar_view_sizing.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -34,7 +33,7 @@ InfoBarIOS::~InfoBarIOS() { ...@@ -34,7 +33,7 @@ InfoBarIOS::~InfoBarIOS() {
controller_ = nil; controller_ = nil;
} }
UIView<InfoBarViewSizing>* InfoBarIOS::view() { UIView* InfoBarIOS::view() {
DCHECK(controller_); DCHECK(controller_);
return [controller_ view]; return [controller_ view];
} }
...@@ -44,17 +43,8 @@ void InfoBarIOS::RemoveView() { ...@@ -44,17 +43,8 @@ void InfoBarIOS::RemoveView() {
[controller_ removeView]; [controller_ removeView];
} }
void InfoBarIOS::PlatformSpecificOnHeightRecalculated() {
DCHECK(controller_);
[controller_ onHeightRecalculated:computed_height()];
}
#pragma mark - InfoBarControllerDelegate #pragma mark - InfoBarControllerDelegate
void InfoBarIOS::SetInfoBarTargetHeight(int height) {
SetTargetHeight(height);
}
bool InfoBarIOS::IsOwned() { bool InfoBarIOS::IsOwned() {
return owner() != nullptr; return owner() != nullptr;
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
// Returns a view with all the infobar elements in it. Will not add it as a // Returns a view with all the infobar elements in it. Will not add it as a
// subview yet. This method must be overriden in subclasses. // subview yet. This method must be overriden in subclasses.
- (UIView<InfoBarViewSizing>*)infobarView; - (UIView*)infobarView;
// Returns whether user interaction with the infobar should be ignored. // Returns whether user interaction with the infobar should be ignored.
- (BOOL)shouldIgnoreUserInteraction; - (BOOL)shouldIgnoreUserInteraction;
......
...@@ -7,33 +7,24 @@ ...@@ -7,33 +7,24 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ios/chrome/browser/ui/infobars/infobar_view_sizing_delegate.h"
namespace infobars { namespace infobars {
class InfoBarDelegate; class InfoBarDelegate;
} // namespace infobars } // namespace infobars
class InfoBarControllerDelegate; class InfoBarControllerDelegate;
@protocol InfoBarViewSizing;
// InfoBar for iOS acts as a UIViewController for InfoBarView. // InfoBar for iOS acts as a UIViewController for InfoBarView.
@interface InfoBarController : NSObject<InfoBarViewSizingDelegate> @interface InfoBarController : NSObject
// Detaches view from its delegate. // Detaches view from its delegate.
// After this function is called, no user interaction can be handled. // After this function is called, no user interaction can be handled.
- (void)detachView; - (void)detachView;
// Returns the actual height in pixels of this infobar instance.
- (int)barHeight;
// Adjusts visible portion of this infobar.
- (void)onHeightRecalculated:(int)newHeight;
// Removes the view. // Removes the view.
- (void)removeView; - (void)removeView;
// Accesses the view. // Accesses the view.
- (UIView<InfoBarViewSizing>*)view; - (UIView*)view;
@property(nonatomic, assign) InfoBarControllerDelegate* delegate; // weak @property(nonatomic, assign) InfoBarControllerDelegate* delegate; // weak
......
...@@ -8,14 +8,13 @@ ...@@ -8,14 +8,13 @@
#include "base/logging.h" #include "base/logging.h"
#include "ios/chrome/browser/infobars/infobar_controller_delegate.h" #include "ios/chrome/browser/infobars/infobar_controller_delegate.h"
#import "ios/chrome/browser/ui/infobars/infobar_view_sizing.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
#endif #endif
@interface InfoBarController () { @interface InfoBarController () {
UIView<InfoBarViewSizing>* _infoBarView; UIView* _infoBarView;
} }
@end @end
...@@ -32,7 +31,6 @@ ...@@ -32,7 +31,6 @@
if (self) { if (self) {
_infoBarDelegate = infoBarDelegate; _infoBarDelegate = infoBarDelegate;
_infoBarView = [self infobarView]; _infoBarView = [self infobarView];
[_infoBarView setSizingDelegate:self];
} }
return self; return self;
} }
...@@ -41,15 +39,7 @@ ...@@ -41,15 +39,7 @@
[_infoBarView removeFromSuperview]; [_infoBarView removeFromSuperview];
} }
- (int)barHeight { - (UIView*)view {
return CGRectGetHeight([_infoBarView frame]);
}
- (void)onHeightRecalculated:(int)newHeight {
[_infoBarView setVisibleHeight:newHeight];
}
- (UIView<InfoBarViewSizing>*)view {
return _infoBarView; return _infoBarView;
} }
...@@ -58,14 +48,13 @@ ...@@ -58,14 +48,13 @@
} }
- (void)detachView { - (void)detachView {
[_infoBarView setSizingDelegate:nil];
_delegate = nullptr; _delegate = nullptr;
_infoBarDelegate = nullptr; _infoBarDelegate = nullptr;
} }
#pragma mark - Protected #pragma mark - Protected
- (UIView<InfoBarViewSizing>*)infobarView { - (UIView*)infobarView {
NOTREACHED() << "Must be overriden in subclasses."; NOTREACHED() << "Must be overriden in subclasses.";
return _infoBarView; return _infoBarView;
} }
...@@ -75,13 +64,4 @@ ...@@ -75,13 +64,4 @@
return !_delegate || !_delegate->IsOwned() || !_infoBarDelegate; return !_delegate || !_delegate->IsOwned() || !_infoBarDelegate;
} }
#pragma mark - InfoBarViewDelegate
- (void)didSetInfoBarTargetHeight:(CGFloat)height {
if (!_delegate)
return;
_delegate->SetInfoBarTargetHeight(height);
}
@end @end
...@@ -10,9 +10,6 @@ ...@@ -10,9 +10,6 @@
// Interface for delegating events from infobar. // Interface for delegating events from infobar.
class InfoBarControllerDelegate { class InfoBarControllerDelegate {
public: public:
// Notifies that the target size has been changed (e.g. after rotation).
virtual void SetInfoBarTargetHeight(int height) = 0;
// Returns whether the infobar is owned. // Returns whether the infobar is owned.
virtual bool IsOwned() = 0; virtual bool IsOwned() = 0;
......
...@@ -50,7 +50,7 @@ enum AlwaysTranslateSwitchState { ...@@ -50,7 +50,7 @@ enum AlwaysTranslateSwitchState {
return [super initWithInfoBarDelegate:infoBarDelegate]; return [super initWithInfoBarDelegate:infoBarDelegate];
} }
- (UIView<InfoBarViewSizing>*)infobarView { - (UIView*)infobarView {
ConfirmInfoBarView* infoBarView = ConfirmInfoBarView* infoBarView =
[[ConfirmInfoBarView alloc] initWithFrame:CGRectZero]; [[ConfirmInfoBarView alloc] initWithFrame:CGRectZero];
// Icon // Icon
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
return [super initWithInfoBarDelegate:infoBarDelegate]; return [super initWithInfoBarDelegate:infoBarDelegate];
} }
- (UIView<InfoBarViewSizing>*)infobarView { - (UIView*)infobarView {
ConfirmInfoBarView* infoBarView = ConfirmInfoBarView* infoBarView =
[[ConfirmInfoBarView alloc] initWithFrame:CGRectZero]; [[ConfirmInfoBarView alloc] initWithFrame:CGRectZero];
_infoBarView = infoBarView; _infoBarView = infoBarView;
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
return [super initWithInfoBarDelegate:infoBarDelegate]; return [super initWithInfoBarDelegate:infoBarDelegate];
} }
- (UIView<InfoBarViewSizing>*)infobarView { - (UIView*)infobarView {
ConfirmInfoBarView* infoBarView = ConfirmInfoBarView* infoBarView =
[[ConfirmInfoBarView alloc] initWithFrame:CGRectZero]; [[ConfirmInfoBarView alloc] initWithFrame:CGRectZero];
// Icon // Icon
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
return [super initWithInfoBarDelegate:infoBarDelegate]; return [super initWithInfoBarDelegate:infoBarDelegate];
} }
- (UIView<InfoBarViewSizing>*)infobarView { - (UIView*)infobarView {
ConfirmInfoBarView* infoBarView = ConfirmInfoBarView* infoBarView =
[[ConfirmInfoBarView alloc] initWithFrame:CGRectZero]; [[ConfirmInfoBarView alloc] initWithFrame:CGRectZero];
// Icon // Icon
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "ios/chrome/browser/infobars/infobar_controller_delegate.h" #include "ios/chrome/browser/infobars/infobar_controller_delegate.h"
#import "ios/chrome/browser/ui/autofill/save_card_infobar_view.h" #import "ios/chrome/browser/ui/autofill/save_card_infobar_view.h"
#import "ios/chrome/browser/ui/autofill/save_card_infobar_view_delegate.h" #import "ios/chrome/browser/ui/autofill/save_card_infobar_view_delegate.h"
#import "ios/chrome/browser/ui/infobars/infobar_view_sizing_delegate.h"
#include "ios/chrome/browser/ui/util/ui_util.h" #include "ios/chrome/browser/ui/util/ui_util.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#include "ios/chrome/grit/ios_theme_resources.h" #include "ios/chrome/grit/ios_theme_resources.h"
...@@ -69,7 +68,7 @@ base::string16 GetTitleForButton(ConfirmInfoBarDelegate* delegate, ...@@ -69,7 +68,7 @@ base::string16 GetTitleForButton(ConfirmInfoBarDelegate* delegate,
return [super initWithInfoBarDelegate:infoBarDelegate]; return [super initWithInfoBarDelegate:infoBarDelegate];
} }
- (UIView<InfoBarViewSizing>*)infobarView { - (UIView*)infobarView {
SaveCardInfoBarView* infoBarView = SaveCardInfoBarView* infoBarView =
[[SaveCardInfoBarView alloc] initWithFrame:CGRectZero]; [[SaveCardInfoBarView alloc] initWithFrame:CGRectZero];
self.infoBarView = infoBarView; self.infoBarView = infoBarView;
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#include <vector> #include <vector>
#import "ios/chrome/browser/ui/infobars/infobar_view_sizing.h"
class GURL; class GURL;
@protocol SaveCardInfoBarViewDelegate; @protocol SaveCardInfoBarViewDelegate;
...@@ -32,7 +30,7 @@ class GURL; ...@@ -32,7 +30,7 @@ class GURL;
// the card's label, and the card's sublabel. In the following section, optional // the card's label, and the card's sublabel. In the following section, optional
// legal messages appear. The bottom section is the footer which contains a // legal messages appear. The bottom section is the footer which contains a
// an optional confirm button and an optional cancel button. // an optional confirm button and an optional cancel button.
@interface SaveCardInfoBarView : UIView<InfoBarViewSizing> @interface SaveCardInfoBarView : UIView
@property(nonatomic, weak) id<SaveCardInfoBarViewDelegate> delegate; @property(nonatomic, weak) id<SaveCardInfoBarViewDelegate> delegate;
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#import "ios/chrome/browser/ui/autofill/save_card_infobar_view_delegate.h" #import "ios/chrome/browser/ui/autofill/save_card_infobar_view_delegate.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/browser/ui/infobars/infobar_constants.h" #import "ios/chrome/browser/ui/infobars/infobar_constants.h"
#import "ios/chrome/browser/ui/infobars/infobar_view_sizing_delegate.h"
#import "ios/chrome/browser/ui/util/label_link_controller.h" #import "ios/chrome/browser/ui/util/label_link_controller.h"
#import "ios/chrome/browser/ui/util/named_guide.h" #import "ios/chrome/browser/ui/util/named_guide.h"
#include "ios/chrome/browser/ui/util/ui_util.h" #include "ios/chrome/browser/ui/util/ui_util.h"
...@@ -87,6 +86,10 @@ UIFont* InfoBarMessageFont() { ...@@ -87,6 +86,10 @@ UIFont* InfoBarMessageFont() {
// Constraint used to add bottom margin to the view. // Constraint used to add bottom margin to the view.
@property(nonatomic) NSLayoutConstraint* footerViewBottomAnchorConstraint; @property(nonatomic) NSLayoutConstraint* footerViewBottomAnchorConstraint;
// How much of the infobar (in points) is visible (e.g., during showing/hiding
// animation).
@property(nonatomic, assign) CGFloat visibleHeight;
// Creates and adds subviews. // Creates and adds subviews.
- (void)setupSubviews; - (void)setupSubviews;
...@@ -127,7 +130,6 @@ UIFont* InfoBarMessageFont() { ...@@ -127,7 +130,6 @@ UIFont* InfoBarMessageFont() {
@implementation SaveCardInfoBarView @implementation SaveCardInfoBarView
@synthesize visibleHeight = _visibleHeight; @synthesize visibleHeight = _visibleHeight;
@synthesize sizingDelegate = _sizingDelegate;
@synthesize delegate = _delegate; @synthesize delegate = _delegate;
@synthesize icon = _icon; @synthesize icon = _icon;
@synthesize googlePayIcon = _googlePayIcon; @synthesize googlePayIcon = _googlePayIcon;
...@@ -167,8 +169,6 @@ UIFont* InfoBarMessageFont() { ...@@ -167,8 +169,6 @@ UIFont* InfoBarMessageFont() {
layoutGuide.layoutFrame.size.height; layoutGuide.layoutFrame.size.height;
[super layoutSubviews]; [super layoutSubviews];
[self.sizingDelegate didSetInfoBarTargetHeight:CGRectGetHeight(self.frame)];
} }
- (CGSize)sizeThatFits:(CGSize)size { - (CGSize)sizeThatFits:(CGSize)size {
......
...@@ -43,8 +43,6 @@ source_set("infobars_ui") { ...@@ -43,8 +43,6 @@ source_set("infobars_ui") {
"infobar_container_consumer.h", "infobar_container_consumer.h",
"infobar_container_view_controller.h", "infobar_container_view_controller.h",
"infobar_container_view_controller.mm", "infobar_container_view_controller.mm",
"infobar_view_sizing.h",
"infobar_view_sizing_delegate.h",
] ]
deps = [ deps = [
":public", ":public",
......
...@@ -8,10 +8,9 @@ ...@@ -8,10 +8,9 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ios/chrome/browser/ui/fancy_ui/bidi_container_view.h" #import "ios/chrome/browser/ui/fancy_ui/bidi_container_view.h"
#import "ios/chrome/browser/ui/infobars/infobar_view_sizing.h"
// An inforbar with an optional message, icon, two action buttons, and a switch. // An inforbar with an optional message, icon, two action buttons, and a switch.
@interface ConfirmInfoBarView : BidiContainerView<InfoBarViewSizing> @interface ConfirmInfoBarView : BidiContainerView
// Label text with links initialized with |stringAsLink:|. // Label text with links initialized with |stringAsLink:|.
@property(nonatomic, strong, readonly) NSString* markedLabel; @property(nonatomic, strong, readonly) NSString* markedLabel;
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/browser/ui/infobars/infobar_constants.h" #import "ios/chrome/browser/ui/infobars/infobar_constants.h"
#import "ios/chrome/browser/ui/infobars/infobar_view_sizing_delegate.h"
#import "ios/chrome/browser/ui/util/label_link_controller.h" #import "ios/chrome/browser/ui/util/label_link_controller.h"
#import "ios/chrome/browser/ui/util/named_guide.h" #import "ios/chrome/browser/ui/util/named_guide.h"
#include "ios/chrome/browser/ui/util/ui_util.h" #include "ios/chrome/browser/ui/util/ui_util.h"
...@@ -330,6 +329,10 @@ UIImage* InfoBarCloseImage() { ...@@ -330,6 +329,10 @@ UIImage* InfoBarCloseImage() {
// Returns the marker delimiting the end of a link. // Returns the marker delimiting the end of a link.
+ (NSString*)closingMarkerForLink; + (NSString*)closingMarkerForLink;
// How much of the infobar (in points) is visible (e.g., during showing/hiding
// animation).
@property(nonatomic, assign) CGFloat visibleHeight;
@end @end
@implementation ConfirmInfoBarView { @implementation ConfirmInfoBarView {
...@@ -363,7 +366,6 @@ UIImage* InfoBarCloseImage() { ...@@ -363,7 +366,6 @@ UIImage* InfoBarCloseImage() {
} }
@synthesize visibleHeight = visibleHeight_; @synthesize visibleHeight = visibleHeight_;
@synthesize sizingDelegate = sizingDelegate_;
- (instancetype)initWithFrame:(CGRect)frame { - (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame]; self = [super initWithFrame:frame];
...@@ -760,10 +762,7 @@ UIImage* InfoBarCloseImage() { ...@@ -760,10 +762,7 @@ UIImage* InfoBarCloseImage() {
- (void)layoutSubviews { - (void)layoutSubviews {
// Lays out the position of the icon. // Lays out the position of the icon.
[imageView_ setFrame:[self frameOfIcon]]; [imageView_ setFrame:[self frameOfIcon]];
targetHeight_ = [self computeRequiredHeightAndLayoutSubviews:YES]; self.visibleHeight = [self computeRequiredHeightAndLayoutSubviews:YES];
if (sizingDelegate_)
[sizingDelegate_ didSetInfoBarTargetHeight:targetHeight_];
[self resetBackground]; [self resetBackground];
// Asks the BidiContainerView to reposition of all the subviews. // Asks the BidiContainerView to reposition of all the subviews.
......
...@@ -19,6 +19,13 @@ const CGFloat kAlphaChangeAnimationDuration = 0.35; ...@@ -19,6 +19,13 @@ const CGFloat kAlphaChangeAnimationDuration = 0.35;
@implementation InfobarContainerViewController @implementation InfobarContainerViewController
// Whenever the container or contained views are re-drawn update the layout to
// match their new size or position.
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
[self updateLayoutAnimated:YES];
}
#pragma mark - InfobarConsumer #pragma mark - InfobarConsumer
- (void)addInfoBarView:(UIView*)infoBarView position:(NSInteger)position { - (void)addInfoBarView:(UIView*)infoBarView position:(NSInteger)position {
......
// Copyright 2018 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.
#ifndef IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_VIEW_SIZING_H_
#define IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_VIEW_SIZING_H_
#import <UIKit/UIKit.h>
@protocol InfoBarViewSizingDelegate;
// Protocol implemented by UIView subclasses representing an infobar. It has
// information about the infobar's visible height and a reference to the
// delegate that gets notified of infobar's height changes.
@protocol InfoBarViewSizing
// How much of the infobar (in points) is visible (e.g., during showing/hiding
// animation).
@property(nonatomic, assign) CGFloat visibleHeight;
// The delegate that gets notified of infobar's height changes.
@property(nonatomic, weak) id<InfoBarViewSizingDelegate> sizingDelegate;
@end
#endif // IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_VIEW_SIZING_H_
// Copyright 2018 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.
#ifndef IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_VIEW_SIZING_DELEGATE_H_
#define IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_VIEW_SIZING_DELEGATE_H_
#import <Foundation/Foundation.h>
// A protocol implemented by a delegate of InfoBarViewSizing.
@protocol InfoBarViewSizingDelegate
// Notifies that the target size has been changed (e.g. after rotation).
- (void)didSetInfoBarTargetHeight:(CGFloat)height;
@end
#endif // IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_VIEW_SIZING_DELEGATE_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment