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_H_
6 #define IOS_CHROME_BROWSER_INFOBARS_INFOBAR_H_
8 #include "base/mac/scoped_nsobject.h"
9 #include "components/infobars/core/infobar.h"
10 #import "ios/public/provider/chrome/browser/ui/infobar_view_delegate.h"
12 @
class InfoBarController
;
15 class InfoBarDelegate
;
18 // InfoBar for iOS acts as a UIViewController for InfoBarView.
19 class InfoBarIOS
: public infobars::InfoBar
, public InfoBarViewDelegate
{
21 explicit InfoBarIOS(scoped_ptr
<infobars::InfoBarDelegate
> delegate
);
22 ~InfoBarIOS() override
;
24 // Layouts the infobar using data from delegate and prepare it for adding to
26 void Layout(CGRect container_bounds
);
28 // Returns UIView holding content of this infobar.
31 // Remove the infobar view from infobar container view.
34 // Sets the controller. Should be called right after the infobar's creation.
35 void SetController(InfoBarController
* controller
);
39 void PlatformSpecificOnHeightsRecalculated() override
;
41 // InfoBarViewDelegate:
42 void SetInfoBarTargetHeight(int height
) override
;
43 void InfoBarDidCancel() override
;
44 void InfoBarButtonDidPress(NSUInteger button_id
) override
;
46 base::scoped_nsobject
<InfoBarController
> controller_
;
47 DISALLOW_COPY_AND_ASSIGN(InfoBarIOS
);
50 #endif // IOS_CHROME_BROWSER_INFOBARS_INFOBAR_H_