blob: c77e229f0d3cc548dc89a8f33681a4214e2dd8ca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
// Copyright 2012 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_INFOBARS_INFOBAR_CONTROLLER_H_
#define IOS_CHROME_BROWSER_INFOBARS_INFOBAR_CONTROLLER_H_
#import <UIKit/UIKit.h>
#include "base/mac/scoped_nsobject.h"
@protocol InfoBarViewProtocol;
class InfoBarViewDelegate;
namespace infobars {
class InfoBarDelegate;
}
// InfoBar for iOS acts as a UIViewController for InfoBarView.
@interface InfoBarController : NSObject
@property(nonatomic, readonly) InfoBarViewDelegate* delegate;
// Designated initializer.
- (instancetype)initWithDelegate:(InfoBarViewDelegate*)delegate
NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
// Creates a view and lays out all the infobar elements in it. Will not add
// it as a subview yet. This method must be overriden in subclasses.
- (base::scoped_nsobject<UIView<InfoBarViewProtocol>>)
viewForDelegate:(infobars::InfoBarDelegate*)delegate
frame:(CGRect)bounds;
// Creates the view.
- (void)layoutForDelegate:(infobars::InfoBarDelegate*)delegate
frame:(CGRect)bounds;
// Detaches view from its delegate.
// After this function is called, no user interaction can be handled.
- (void)detachView;
// Returns the actual height in pixels of this infobar instance.
- (int)barHeight;
// Adjusts visible portion of this infobar.
- (void)onHeightsRecalculated:(int)newHeight;
// Removes the view.
- (void)removeView;
// Accesses the view.
- (UIView<InfoBarViewProtocol>*)view;
@end
#endif // IOS_CHROME_BROWSER_INFOBARS_INFOBAR_CONTROLLER_H_
|