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>
10 #include "base/basictypes.h"
11 #include "base/mac/scoped_nsobject.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "components/infobars/core/infobar.h"
15 @protocol InfoBarViewProtocol
;
16 class InfoBarViewDelegate
;
18 // InfoBar for iOS acts as a UIViewController for InfoBarView.
19 @interface InfoBarController
: NSObject
{
21 base::scoped_nsobject
<UIView
<InfoBarViewProtocol
>> infoBarView_
;
22 __weak InfoBarViewDelegate
* delegate_
;
25 // Creates a view and lays out all the infobar elements in it. Will not add
26 // it as a subview yet. This method must be overriden in subclasses.
27 - (void)layoutForDelegate
:(infobars::InfoBarDelegate
*)delegate
30 // Designated initializer.
31 - (instancetype
)initWithDelegate
:(InfoBarViewDelegate
*)delegate
;
33 // Detaches view from its delegate.
34 // After this function is called, no user interaction can be handled.
37 // Returns the actual height in pixels of this infobar instance.
40 // Adjusts visible portion of this infobar.
41 - (void)onHeightsRecalculated
:(int)newHeight
;
51 #endif // IOS_CHROME_BROWSER_INFOBARS_INFOBAR_CONTROLLER_H_