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

Side by Side Diff: ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.mm

Issue 2724233003: Adding haptics for more HUD uses. (Closed)
Patch Set: Rebase Created 3 years, 9 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 (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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/bookmarks/bookmark_utils_ios.h" 5 #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 [[[MDCSnackbarMessageAction alloc] init] autorelease]; 264 [[[MDCSnackbarMessageAction alloc] init] autorelease];
265 action.handler = ^{ 265 action.handler = ^{
266 if (![wrapper hasUndoManagerChanged]) 266 if (![wrapper hasUndoManagerChanged])
267 [wrapper undo]; 267 [wrapper undo];
268 }; 268 };
269 269
270 action.title = l10n_util::GetNSString(IDS_IOS_BOOKMARK_NEW_UNDO_BUTTON_TITLE); 270 action.title = l10n_util::GetNSString(IDS_IOS_BOOKMARK_NEW_UNDO_BUTTON_TITLE);
271 action.accessibilityIdentifier = @"Undo"; 271 action.accessibilityIdentifier = @"Undo";
272 action.accessibilityLabel = 272 action.accessibilityLabel =
273 l10n_util::GetNSString(IDS_IOS_BOOKMARK_NEW_UNDO_BUTTON_TITLE); 273 l10n_util::GetNSString(IDS_IOS_BOOKMARK_NEW_UNDO_BUTTON_TITLE);
274 TriggerHapticFeedbackForNotification(UINotificationFeedbackTypeSuccess);
274 MDCSnackbarMessage* message = [MDCSnackbarMessage messageWithText:text]; 275 MDCSnackbarMessage* message = [MDCSnackbarMessage messageWithText:text];
275 message.action = action; 276 message.action = action;
276 message.category = kBookmarksSnackbarCategory; 277 message.category = kBookmarksSnackbarCategory;
277 [MDCSnackbarManager showMessage:message]; 278 [MDCSnackbarManager showMessage:message];
278 } 279 }
279 280
280 void DeleteBookmarks(const std::set<const BookmarkNode*>& bookmarks, 281 void DeleteBookmarks(const std::set<const BookmarkNode*>& bookmarks,
281 bookmarks::BookmarkModel* model) { 282 bookmarks::BookmarkModel* model) {
282 DCHECK(model->loaded()); 283 DCHECK(model->loaded());
283 DeleteBookmarks(bookmarks, model, model->root_node()); 284 DeleteBookmarks(bookmarks, model, model->root_node());
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 676
676 *position = cache.position; 677 *position = cache.position;
677 return YES; 678 return YES;
678 } 679 }
679 680
680 void ClearPositionCache() { 681 void ClearPositionCache() {
681 [[NSUserDefaults standardUserDefaults] removeObjectForKey:kPositionCacheKey]; 682 [[NSUserDefaults standardUserDefaults] removeObjectForKey:kPositionCacheKey];
682 } 683 }
683 684
684 } // namespace bookmark_utils_ios 685 } // namespace bookmark_utils_ios
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698