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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/ui/uikit_ui_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/uikit_ui_util.mm
diff --git a/ios/chrome/browser/ui/uikit_ui_util.mm b/ios/chrome/browser/ui/uikit_ui_util.mm
index 45d3ce5d0403735a1c11072793906ba0c6ef518d..6c9308aeb02af884b2fe02a90a9e75e4c45ff185 100644
--- a/ios/chrome/browser/ui/uikit_ui_util.mm
+++ b/ios/chrome/browser/ui/uikit_ui_util.mm
@@ -681,3 +681,13 @@ void TriggerHapticFeedbackForSelectionChange() {
[generator selectionChanged];
}
}
+
+// On iOS10 and above, trigger a haptic vibration for a notification.
+// This is a no-op for devices that do not support it.
+void TriggerHapticFeedbackForNotification(UINotificationFeedbackType type) {
+ if (base::ios::IsRunningOnIOS10OrLater()) {
+ UINotificationFeedbackGenerator* generator =
+ [[UINotificationFeedbackGenerator alloc] init];
+ [generator notificationOccurred:type];
+ }
+}
« 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