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_WIDGET_EXTENSION_WIDGET_VIEW_H_ |
6 #define IOS_CHROME_WIDGET_EXTENSION_WIDGET_VIEW_H_ | 6 #define IOS_CHROME_WIDGET_EXTENSION_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 |
11 // view. | 11 // view. |
12 @protocol WidgetViewActionTarget | 12 @protocol WidgetViewActionTarget |
13 | 13 |
14 // Called when the user taps the fake omnibox. | 14 // Called when the user taps the Search button. |
15 - (void)openApp:(id)sender; | 15 - (void)openSearch:(id)sender; |
| 16 // Called when the user taps the Incognito Search button. |
| 17 - (void)openIncognito:(id)sender; |
| 18 // Called when the user taps the Voice Search button. |
| 19 - (void)openVoice:(id)sender; |
| 20 // Called when the user taps the QR Code button. |
| 21 - (void)openQRCode:(id)sender; |
| 22 // Called when the user taps the Open Copied URL section. |
| 23 - (void)openCopiedURL:(id)sender; |
16 | 24 |
17 @end | 25 @end |
18 | 26 |
19 // View for the widget. Shows a blinking cursor for a fake omnibox and calls the | 27 // View for the widget. Shows a blinking cursor for a fake omnibox and calls the |
20 // target when tapped. | 28 // target when tapped. |
21 @interface WidgetView : UIView | 29 @interface WidgetView : UIView |
22 | 30 |
23 // Designated initializer, creates the widget view with a |target| for user | 31 // Designated initializer, creates the widget view with a |target| for user |
24 // actions. | 32 // actions. |
25 - (instancetype)initWithActionTarget:(id<WidgetViewActionTarget>)target | 33 - (instancetype)initWithActionTarget:(id<WidgetViewActionTarget>)target |
26 NS_DESIGNATED_INITIALIZER; | 34 NS_DESIGNATED_INITIALIZER; |
27 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; | 35 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; |
28 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; | 36 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; |
29 | 37 |
| 38 // Updates the copied URL. |
| 39 - (void)updateCopiedURL:(NSString*)copiedURL; |
| 40 |
30 @end | 41 @end |
31 | 42 |
32 #endif // IOS_CHROME_WIDGET_EXTENSION_WIDGET_VIEW_H_ | 43 #endif // IOS_CHROME_WIDGET_EXTENSION_WIDGET_VIEW_H_ |
OLD | NEW |