OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 | 4 |
5 #ifndef IOS_CHROME_WIDGET_EXTENSION_WIDGET_VIEW_H_ | 5 #ifndef IOS_CHROME_SEARCH_WIDGET_EXTENSION_SEARCH_WIDGET_VIEW_H_ |
6 #define IOS_CHROME_WIDGET_EXTENSION_WIDGET_VIEW_H_ | 6 #define IOS_CHROME_SEARCH_WIDGET_EXTENSION_SEARCH_WIDGET_VIEW_H_ |
7 | 7 |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 // Protocol to be implemented by targets for user actions coming from the widget | 10 // Protocol to be implemented by targets for user actions coming from the widget |
sdefresne
2017/04/12 15:15:25
nit: ... user actions coming from the search widge
lody
2017/04/12 15:35:31
Done.
| |
11 // view. | 11 // view. |
12 @protocol WidgetViewActionTarget | 12 @protocol SearchWidgetViewActionTarget |
13 | 13 |
14 // Called when the user taps the Search button. | 14 // Called when the user taps the Search button. |
15 - (void)openSearch:(id)sender; | 15 - (void)openSearch:(id)sender; |
16 // Called when the user taps the Incognito Search button. | 16 // Called when the user taps the Incognito Search button. |
17 - (void)openIncognito:(id)sender; | 17 - (void)openIncognito:(id)sender; |
18 // Called when the user taps the Voice Search button. | 18 // Called when the user taps the Voice Search button. |
19 - (void)openVoice:(id)sender; | 19 - (void)openVoice:(id)sender; |
20 // Called when the user taps the QR Code button. | 20 // Called when the user taps the QR Code button. |
21 - (void)openQRCode:(id)sender; | 21 - (void)openQRCode:(id)sender; |
22 // Called when the user taps the Open Copied URL section. | 22 // Called when the user taps the Open Copied URL section. |
23 - (void)openCopiedURL:(id)sender; | 23 - (void)openCopiedURL:(id)sender; |
24 | 24 |
25 @end | 25 @end |
26 | 26 |
27 // View for the widget. Shows a blinking cursor for a fake omnibox and calls the | 27 // View for the search widget. Shows a blinking cursor for a fake omnibox and |
28 // target when tapped. | 28 // calls the target when tapped. |
29 @interface WidgetView : UIView | 29 @interface SearchWidgetView : UIView |
30 | 30 |
31 // Designated initializer, creates the widget view with a |target| for user | 31 // Designated initializer, creates the widget view with a |target| for user |
32 // actions. | 32 // actions. |
33 - (instancetype)initWithActionTarget:(id<WidgetViewActionTarget>)target | 33 - (instancetype)initWithActionTarget:(id<SearchWidgetViewActionTarget>)target |
34 NS_DESIGNATED_INITIALIZER; | 34 NS_DESIGNATED_INITIALIZER; |
35 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; | 35 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; |
36 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; | 36 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; |
37 | 37 |
38 // Updates the copied URL. | 38 // Updates the copied URL. |
39 - (void)updateCopiedURL:(NSString*)copiedURL; | 39 - (void)updateCopiedURL:(NSString*)copiedURL; |
40 | 40 |
41 @end | 41 @end |
42 | 42 |
43 #endif // IOS_CHROME_WIDGET_EXTENSION_WIDGET_VIEW_H_ | 43 #endif // IOS_CHROME_SEARCH_WIDGET_EXTENSION_SEARCH_WIDGET_VIEW_H_ |
OLD | NEW |