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

Side by Side Diff: ios/chrome/browser/ui/uikit_ui_util.mm

Issue 2719513003: Adding success/failure notification haptics for HUD display. (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
« no previous file with comments | « ios/chrome/browser/ui/uikit_ui_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 4
5 #import "ios/chrome/browser/ui/uikit_ui_util.h" 5 #import "ios/chrome/browser/ui/uikit_ui_util.h"
6 6
7 #import <Accelerate/Accelerate.h> 7 #import <Accelerate/Accelerate.h>
8 #import <Foundation/Foundation.h> 8 #import <Foundation/Foundation.h>
9 #import <QuartzCore/QuartzCore.h> 9 #import <QuartzCore/QuartzCore.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 674
675 // On iOS10 and above, trigger a haptic vibration for the change in selection. 675 // On iOS10 and above, trigger a haptic vibration for the change in selection.
676 // This is a no-op for devices that do not support it. 676 // This is a no-op for devices that do not support it.
677 void TriggerHapticFeedbackForSelectionChange() { 677 void TriggerHapticFeedbackForSelectionChange() {
678 if (base::ios::IsRunningOnIOS10OrLater()) { 678 if (base::ios::IsRunningOnIOS10OrLater()) {
679 UISelectionFeedbackGenerator* generator = 679 UISelectionFeedbackGenerator* generator =
680 [[UISelectionFeedbackGenerator alloc] init]; 680 [[UISelectionFeedbackGenerator alloc] init];
681 [generator selectionChanged]; 681 [generator selectionChanged];
682 } 682 }
683 } 683 }
684
685 // On iOS10 and above, trigger a haptic vibration for a notification.
686 // This is a no-op for devices that do not support it.
687 void TriggerHapticFeedbackForNotification(UINotificationFeedbackType type) {
688 if (base::ios::IsRunningOnIOS10OrLater()) {
689 UINotificationFeedbackGenerator* generator =
690 [[UINotificationFeedbackGenerator alloc] init];
691 [generator notificationOccurred:type];
692 }
693 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/uikit_ui_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698