OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 #ifndef IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_VIEW_H_ | 4 #ifndef IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_VIEW_H_ |
5 #define IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_VIEW_H_ | 5 #define IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_VIEW_H_ |
6 | 6 |
7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
8 | 8 |
9 #import "ios/chrome/browser/ui/fancy_ui/bidi_container_view.h" | 9 #import "ios/chrome/browser/ui/fancy_ui/bidi_container_view.h" |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 // Creates a new string from |string| that is interpreted as a link by | 45 // Creates a new string from |string| that is interpreted as a link by |
46 // |addLabel:|. |tag| must not be 0. | 46 // |addLabel:|. |tag| must not be 0. |
47 + (NSString*)stringAsLink:(NSString*)string tag:(NSUInteger)tag; | 47 + (NSString*)stringAsLink:(NSString*)string tag:(NSUInteger)tag; |
48 | 48 |
49 // Adds a message to the infobar that optionaly contains links initialized with | 49 // Adds a message to the infobar that optionaly contains links initialized with |
50 // |stringAsLink:|. | 50 // |stringAsLink:|. |
51 - (void)addLabel:(NSString*)label; | 51 - (void)addLabel:(NSString*)label; |
52 | 52 |
53 // Adds a message to the infobar that optionaly contains links initialized with | 53 // Adds a message to the infobar that optionaly contains links initialized with |
54 // |stringAsLink:|. |action| is called on |target| when a link is clicked. | 54 // |stringAsLink:|. |action| is called when a link is clicked, with the tag |
55 - (void)addLabel:(NSString*)label target:(id)target action:(SEL)action; | 55 // associated with the link passed as a parameter.. |
| 56 - (void)addLabel:(NSString*)label action:(void (^)(NSUInteger))action; |
56 | 57 |
57 // Adds two buttons to the infobar. Button1 is the primary action of the infobar | 58 // Adds two buttons to the infobar. Button1 is the primary action of the infobar |
58 // and in Material Design mode is shown with bold colors to reflect this role. | 59 // and in Material Design mode is shown with bold colors to reflect this role. |
59 - (void)addButton1:(NSString*)title1 | 60 - (void)addButton1:(NSString*)title1 |
60 tag1:(NSInteger)tag1 | 61 tag1:(NSInteger)tag1 |
61 button2:(NSString*)title2 | 62 button2:(NSString*)title2 |
62 tag2:(NSInteger)tag2 | 63 tag2:(NSInteger)tag2 |
63 target:(id)target | 64 target:(id)target |
64 action:(SEL)action; | 65 action:(SEL)action; |
65 | 66 |
66 // Adds a button to the infobar. | 67 // Adds a button to the infobar. |
67 - (void)addButton:(NSString*)title | 68 - (void)addButton:(NSString*)title |
68 tag:(NSInteger)tag | 69 tag:(NSInteger)tag |
69 target:(id)target | 70 target:(id)target |
70 action:(SEL)action; | 71 action:(SEL)action; |
71 | 72 |
72 // Adds to the infobar a switch and an adjacent label. | 73 // Adds to the infobar a switch and an adjacent label. |
73 - (void)addSwitchWithLabel:(NSString*)label | 74 - (void)addSwitchWithLabel:(NSString*)label |
74 isOn:(BOOL)isOn | 75 isOn:(BOOL)isOn |
75 tag:(NSInteger)tag | 76 tag:(NSInteger)tag |
76 target:(id)target | 77 target:(id)target |
77 action:(SEL)action; | 78 action:(SEL)action; |
78 | 79 |
79 @end | 80 @end |
80 | 81 |
81 #endif // IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_VIEW_H_ | 82 #endif // IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_VIEW_H_ |
OLD | NEW |