Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: ios/chrome/search_widget_extension/search_widget_view.h

Issue 2858253002: Adding search widget UI and functionality. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_SEARCH_WIDGET_EXTENSION_SEARCH_WIDGET_VIEW_H_ 5 #ifndef IOS_CHROME_SEARCH_WIDGET_EXTENSION_SEARCH_WIDGET_VIEW_H_
6 #define IOS_CHROME_SEARCH_WIDGET_EXTENSION_SEARCH_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 search 10 // Protocol to be implemented by targets for user actions coming from the search
11 // widget view. 11 // widget view.
12 @protocol SearchWidgetViewActionTarget 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 search widget. Shows a blinking cursor for a fake omnibox and 27 // View for the search widget. Shows a blinking cursor for a fake omnibox and
stkhapugin 2017/05/04 13:12:08 This is no longer accurate.
lody 2017/05/05 17:05:43 Done.
28 // calls the target when tapped. 28 // calls the target when tapped.
29 @interface SearchWidgetView : UIView 29 @interface SearchWidgetView : UIView
30 30
31 // Set this property to show/hide the copied URL section.
32 @property(nonatomic) BOOL copiedURLVisible;
33
31 // Designated initializer, creates the widget view with a |target| for user 34 // Designated initializer, creates the widget view with a |target| for user
32 // actions. 35 // actions. View elements will be added to the |primaryVibrancyEffect| and
36 // |secondaryVibrancyEffect| views.
33 - (instancetype)initWithActionTarget:(id<SearchWidgetViewActionTarget>)target 37 - (instancetype)initWithActionTarget:(id<SearchWidgetViewActionTarget>)target
38 primaryVibrancyEffect:(UIVibrancyEffect*)primaryVibrancyEffect
39 secondaryVibrancyEffect:(UIVibrancyEffect*)secondaryVibrancyEffect
34 NS_DESIGNATED_INITIALIZER; 40 NS_DESIGNATED_INITIALIZER;
35 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; 41 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
36 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE; 42 - (instancetype)initWithCoder:(NSCoder*)aDecoder NS_UNAVAILABLE;
37 43
38 // Updates the copied URL. 44 // Updates the copied URL.
39 - (void)updateCopiedURL:(NSString*)copiedURL; 45 - (void)updateCopiedURL:(NSString*)copiedURL;
stkhapugin 2017/05/04 13:12:08 Should this be a setter on a property |copiedURL|
lpromero 2017/05/05 14:02:00 Some people don't like non-trivial setters.
lody 2017/05/05 17:05:42 Seeing as how I already had a non-trivial setter f
lody 2017/05/05 17:05:43 Done.
40 46
41 @end 47 @end
42 48
43 #endif // IOS_CHROME_SEARCH_WIDGET_EXTENSION_SEARCH_WIDGET_VIEW_H_ 49 #endif // IOS_CHROME_SEARCH_WIDGET_EXTENSION_SEARCH_WIDGET_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698