Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / ios / public / provider / chrome / browser / ui / infobar_view_protocol.h
blob02aed8b1761c79f98b02fb2f9d04ec8c6d4e2b71
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 // The designated initializer.
21 - (instancetype)initWithFrame:(CGRect)frame
22 delegate:(InfoBarViewDelegate*)delegate;
24 // Stops propagating events to delegate.
25 - (void)resetDelegate;
27 // TODO(jif): rename methods from add* to set*. crbug.com/302582
28 // Adds a dismiss button subview.
29 - (void)addCloseButtonWithTag:(NSInteger)tag
30 target:(id)target
31 action:(SEL)action;
33 // Adds icon subview.
34 - (void)addLeftIcon:(UIImage*)image;
36 // Adds transparent icon of size |imageSize| as placeholder during the time when
37 // the icon is being downloaded.
38 - (void)addPlaceholderTransparentIcon:(CGSize const&)imageSize;
40 // Adds an icon subview with rounded corners and a shadow.
41 - (void)addLeftIconWithRoundedCornersAndShadow:(UIImage*)image;
43 // Creates a new string from |string| that is interpreted as a link by
44 // |addLabel:|. |tag| must not be 0.
45 + (NSString*)stringAsLink:(NSString*)string tag:(NSUInteger)tag;
47 // Adds a message to the infobar that optionaly contains links initialized with
48 // |stringAsLink:|.
49 - (void)addLabel:(NSString*)label;
51 // Adds a message to the infobar that optionaly contains links initialized with
52 // |stringAsLink:|. |action| is called on |target| when a link is clicked.
53 - (void)addLabel:(NSString*)label target:(id)target action:(SEL)action;
55 // Adds two buttons to the infobar. Button1 is the primary action of the infobar
56 // and in Material Design mode is shown with bold colors to reflect this role.
57 - (void)addButton1:(NSString*)title1
58 tag1:(NSInteger)tag1
59 button2:(NSString*)title2
60 tag2:(NSInteger)tag2
61 target:(id)target
62 action:(SEL)action;
64 // Adds a button to the infobar.
65 - (void)addButton:(NSString*)title
66 tag:(NSInteger)tag
67 target:(id)target
68 action:(SEL)action;
70 // Adds to the infobar a switch and an adjacent label.
71 - (void)addSwitchWithLabel:(NSString*)label
72 isOn:(BOOL)isOn
73 tag:(NSInteger)tag
74 target:(id)target
75 action:(SEL)action;
77 @end
79 #endif // IOS_PUBLIC_PROVIDER_CHROME_BROWSER_UI_INFOBAR_VIEW_PROTOCOL_H_