1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef IOS_CHROME_BROWSER_INFOBARS_INFOBAR_CONTROLLER_H_
6 #define IOS_CHROME_BROWSER_INFOBARS_INFOBAR_CONTROLLER_H_
8 #import <UIKit/UIKit.h>
9 #include "base/mac/scoped_nsobject.h"
11 @protocol InfoBarViewProtocol
;
12 class InfoBarViewDelegate
;
14 class InfoBarDelegate
;
17 // InfoBar for iOS acts as a UIViewController for InfoBarView.
18 @interface InfoBarController
: NSObject
20 @
property(nonatomic
, readonly
) InfoBarViewDelegate
* delegate
;
21 // Designated initializer.
22 - (instancetype
)initWithDelegate
:(InfoBarViewDelegate
*)delegate
23 NS_DESIGNATED_INITIALIZER
;
25 - (instancetype
)init NS_UNAVAILABLE
;
27 // Creates a view and lays out all the infobar elements in it. Will not add
28 // it as a subview yet. This method must be overriden in subclasses.
29 - (base::scoped_nsobject
<UIView
<InfoBarViewProtocol
>>)
30 viewForDelegate
:(infobars::InfoBarDelegate
*)delegate
34 - (void)layoutForDelegate
:(infobars::InfoBarDelegate
*)delegate
37 // Detaches view from its delegate.
38 // After this function is called, no user interaction can be handled.
41 // Returns the actual height in pixels of this infobar instance.
44 // Adjusts visible portion of this infobar.
45 - (void)onHeightsRecalculated
:(int)newHeight
;
51 - (UIView
<InfoBarViewProtocol
>*)view
;
55 #endif // IOS_CHROME_BROWSER_INFOBARS_INFOBAR_CONTROLLER_H_