Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / ios / public / provider / chrome / browser / ui / infobar_view_protocol.h
blob26517a1f25451b6e5a8a97b6ed8d3c220a846129
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 #ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_UI_INFOBAR_VIEW_PROTOCOL_H_
6 #define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_UI_INFOBAR_VIEW_PROTOCOL_H_
8 #import <Foundation/Foundation.h>
10 struct CGSize;
11 class InfoBarViewDelegate;
12 @class UIImage;
14 // Interface for setting up the infobar's widgets.
15 @protocol InfoBarViewProtocol
16 // How much of infobar is visible. The infobar is only partly visible during
17 // showing/hiding animation.
18 @property(nonatomic, assign) CGFloat visibleHeight;
20 // Stops propagating events to delegate.
21 - (void)resetDelegate;
23 // TODO(jif): rename methods from add* to set*. crbug.com/302582
24 // Adds a dismiss button subview.
25 - (void)addCloseButtonWithTag:(NSInteger)tag
26 target:(id)target
27 action:(SEL)action;
29 // Adds icon subview.
30 - (void)addLeftIcon:(UIImage*)image;
32 // Adds transparent icon of size |imageSize| as placeholder during the time when
33 // the icon is being downloaded.
34 - (void)addPlaceholderTransparentIcon:(CGSize const&)imageSize;
36 // Adds an icon subview with rounded corners and a shadow.
37 - (void)addLeftIconWithRoundedCornersAndShadow:(UIImage*)image;
39 // Creates a new string from |string| that is interpreted as a link by
40 // |addLabel:|. |tag| must not be 0.
41 + (NSString*)stringAsLink:(NSString*)string tag:(NSUInteger)tag;
43 // Adds a message to the infobar that optionaly contains links initialized with
44 // |stringAsLink:|.
45 - (void)addLabel:(NSString*)label;
47 // Adds a message to the infobar that optionaly contains links initialized with
48 // |stringAsLink:|. |action| is called on |target| when a link is clicked.
49 - (void)addLabel:(NSString*)label target:(id)target action:(SEL)action;
51 // Adds two buttons to the infobar. Button1 is the primary action of the infobar
52 // and in Material Design mode is shown with bold colors to reflect this role.
53 - (void)addButton1:(NSString*)title1
54 tag1:(NSInteger)tag1
55 button2:(NSString*)title2
56 tag2:(NSInteger)tag2
57 target:(id)target
58 action:(SEL)action;
60 // Adds a button to the infobar.
61 - (void)addButton:(NSString*)title
62 tag:(NSInteger)tag
63 target:(id)target
64 action:(SEL)action;
66 // Adds to the infobar a switch and an adjacent label.
67 - (void)addSwitchWithLabel:(NSString*)label
68 isOn:(BOOL)isOn
69 tag:(NSInteger)tag
70 target:(id)target
71 action:(SEL)action;
73 @end
75 #endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_UI_INFOBAR_VIEW_PROTOCOL_H_