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

Unified Diff: ios/chrome/browser/ui/browser_view_controller.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 | « no previous file | ios/chrome/browser/ui/uikit_ui_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/browser_view_controller.mm
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
index 9b3b3afa3ff9a8cbe9cf40f7fc6d4b47c8adb8b0..f6a0762ae64cb2a1634f1edf862b3fc178ed018e 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -3406,6 +3406,7 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
// redirection to an un-printable page can happen before it is reflected in
// the UI.
if (![currentTab viewForPrinting]) {
+ TriggerHapticFeedbackForNotification(UINotificationFeedbackTypeError);
[self showSnackbar:l10n_util::GetNSString(IDS_IOS_CANNOT_PRINT_PAGE_ERROR)];
return;
}
@@ -3430,6 +3431,7 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
readingModel->AddEntry(URL, base::SysNSStringToUTF8(title),
reading_list::ADDED_VIA_CURRENT_APP);
+ TriggerHapticFeedbackForNotification(UINotificationFeedbackTypeSuccess);
[self showSnackbar:l10n_util::GetNSString(
IDS_IOS_READING_LIST_SNACKBAR_MESSAGE)];
}
@@ -4851,8 +4853,10 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
switch (shareStatus) {
case ShareTo::SHARE_SUCCESS:
- if ([message length])
+ if ([message length]) {
+ TriggerHapticFeedbackForNotification(UINotificationFeedbackTypeSuccess);
[self showSnackbar:message];
+ }
break;
case ShareTo::SHARE_ERROR:
[self showErrorAlert:IDS_IOS_SHARE_TO_ERROR_ALERT_TITLE
@@ -4886,6 +4890,8 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
completionHandler:^(BOOL completed) {
if (shown || !completed || ![message length])
return;
+ TriggerHapticFeedbackForNotification(
+ UINotificationFeedbackTypeSuccess);
[self showSnackbar:message];
shown = YES;
}];
« no previous file with comments | « no previous file | ios/chrome/browser/ui/uikit_ui_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698