1 // Copyright 2013 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 #include "ios/chrome/browser/infobars/infobar_controller.h"
7 #include "base/strings/sys_string_conversions.h"
8 #include "components/infobars/core/confirm_infobar_delegate.h"
9 #import "ios/public/provider/chrome/browser/ui/infobar_view_protocol.h"
10 #include "ui/gfx/image/image.h"
12 @implementation InfoBarController
14 - (instancetype)initWithDelegate:(InfoBarViewDelegate*)delegate {
24 [infoBarView_ removeFromSuperview];
29 return CGRectGetHeight([infoBarView_ frame]);
32 - (void)layoutForDelegate:(infobars::InfoBarDelegate*)delegate
33 frame:(CGRect)bounds {
34 // Must be overriden in subclasses.
38 - (void)onHeightsRecalculated:(int)newHeight {
39 [infoBarView_ setVisibleHeight:newHeight];
47 [infoBarView_ removeFromSuperview];
51 [infoBarView_ resetDelegate];