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

Side by Side Diff: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.h

Issue 2680343002: Add haptic feedback for selection change and action trigger. (Closed)
Patch Set: Created 3 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_BROWSER_UI_OVERSCROLL_ACTIONS_OVERSCROLL_ACTIONS_VIEW_H_ 5 #ifndef IOS_CHROME_BROWSER_UI_OVERSCROLL_ACTIONS_OVERSCROLL_ACTIONS_VIEW_H_
6 #define IOS_CHROME_BROWSER_UI_OVERSCROLL_ACTIONS_OVERSCROLL_ACTIONS_VIEW_H_ 6 #define IOS_CHROME_BROWSER_UI_OVERSCROLL_ACTIONS_OVERSCROLL_ACTIONS_VIEW_H_
7 7
8 #import <UIKit/UIKit.h> 8 #import <UIKit/UIKit.h>
9 9
10 // Describes the current Index of an action in the OverScrollActionsView. 10 // Describes the current Index of an action in the OverScrollActionsView.
11 enum class OverscrollAction { 11 enum class OverscrollAction {
12 NONE, // No action 12 NONE, // No action
13 NEW_TAB, // New tab action 13 NEW_TAB, // New tab action
14 REFRESH, // Refresh action 14 REFRESH, // Refresh action
15 CLOSE_TAB, // Close tab action 15 CLOSE_TAB, // Close tab action
16 }; 16 };
17 17
18 // Describes the style of the overscroll action UI. 18 // Describes the style of the overscroll action UI.
19 enum class OverscrollStyle { 19 enum class OverscrollStyle {
20 NTP_NON_INCOGNITO, // UI to fit the NTP in non incognito. 20 NTP_NON_INCOGNITO, // UI to fit the NTP in non incognito.
21 NTP_INCOGNITO, // UI to fit the NTP in incognito. 21 NTP_INCOGNITO, // UI to fit the NTP in incognito.
22 REGULAR_PAGE_NON_INCOGNITO, // UI to fit regular pages in non incognito. 22 REGULAR_PAGE_NON_INCOGNITO, // UI to fit regular pages in non incognito.
23 REGULAR_PAGE_INCOGNITO // UI to fit regular pages in incognito. 23 REGULAR_PAGE_INCOGNITO // UI to fit regular pages in incognito.
24 }; 24 };
25 25
26 @class OverscrollActionsView; 26 @class OverscrollActionsView;
27 27
28 @protocol OverscrollActionsViewDelegate 28 @protocol OverscrollActionsViewDelegate
29 29
30 // Called when the user explicitly taps on one of the items to trigger its
31 // action.
30 - (void)overscrollActionsViewDidTapTriggerAction: 32 - (void)overscrollActionsViewDidTapTriggerAction:
31 (OverscrollActionsView*)overscrollActionsView; 33 (OverscrollActionsView*)overscrollActionsView;
32 34
35 // Called after the selectedAction property changed and the animations have
36 // been triggered.
37 - (void)overscrollActionsView:(OverscrollActionsView*)view
38 selectedActionDidChange:(OverscrollAction)newAction;
39
33 @end 40 @end
34 41
35 // This view displays the actions of the OverscrollActionsController. 42 // This view displays the actions of the OverscrollActionsController.
36 // How actions are displayed depends on the vertical and horizontal offsets. 43 // How actions are displayed depends on the vertical and horizontal offsets.
37 @interface OverscrollActionsView : UIView 44 @interface OverscrollActionsView : UIView
38 45
39 // The currently selected action. 46 // The currently selected action.
40 @property(nonatomic, assign, readonly) OverscrollAction selectedAction; 47 @property(nonatomic, assign, readonly) OverscrollAction selectedAction;
41 // The view displayed has the background of the overscroll actions view. 48 // The view displayed has the background of the overscroll actions view.
42 @property(nonatomic, retain, readonly) UIView* backgroundView; 49 @property(nonatomic, retain, readonly) UIView* backgroundView;
(...skipping 22 matching lines...) Expand all
65 // This starts an "ink response" like animation typically triggered when an 72 // This starts an "ink response" like animation typically triggered when an
66 // action has been selected. 73 // action has been selected.
67 - (void)displayActionAnimation; 74 - (void)displayActionAnimation;
68 75
69 // Sets the style of the overscroll action UI. 76 // Sets the style of the overscroll action UI.
70 - (void)setStyle:(OverscrollStyle)style; 77 - (void)setStyle:(OverscrollStyle)style;
71 78
72 @end 79 @end
73 80
74 #endif // IOS_CHROME_BROWSER_UI_OVERSCROLL_ACTIONS_OVERSCROLL_ACTIONS_VIEW_H_ 81 #endif // IOS_CHROME_BROWSER_UI_OVERSCROLL_ACTIONS_OVERSCROLL_ACTIONS_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698