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

Side by Side Diff: ios/chrome/browser/ui/bookmarks/bookmark_interaction_controller.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
« no previous file with comments | « no previous file | ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_interaction_controller.h" 5 #import "ios/chrome/browser/ui/bookmarks/bookmark_interaction_controller.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #import "base/ios/weak_nsobject.h" 9 #import "base/ios/weak_nsobject.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 12 matching lines...) Expand all
23 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h" 23 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h"
24 #include "ios/chrome/browser/browser_state/chrome_browser_state.h" 24 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
25 #import "ios/chrome/browser/metrics/new_tab_page_uma.h" 25 #import "ios/chrome/browser/metrics/new_tab_page_uma.h"
26 #include "ios/chrome/browser/pref_names.h" 26 #include "ios/chrome/browser/pref_names.h"
27 #import "ios/chrome/browser/tabs/tab.h" 27 #import "ios/chrome/browser/tabs/tab.h"
28 #import "ios/chrome/browser/ui/bookmarks/bookmark_controller_factory.h" 28 #import "ios/chrome/browser/ui/bookmarks/bookmark_controller_factory.h"
29 #import "ios/chrome/browser/ui/bookmarks/bookmark_edit_view_controller.h" 29 #import "ios/chrome/browser/ui/bookmarks/bookmark_edit_view_controller.h"
30 #import "ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller.h" 30 #import "ios/chrome/browser/ui/bookmarks/bookmark_home_view_controller.h"
31 #import "ios/chrome/browser/ui/bookmarks/bookmark_navigation_controller.h" 31 #import "ios/chrome/browser/ui/bookmarks/bookmark_navigation_controller.h"
32 #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h" 32 #import "ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.h"
33 #include "ios/chrome/browser/ui/ui_util.h" 33 #include "ios/chrome/browser/ui/uikit_ui_util.h"
34 #include "ios/chrome/browser/ui/url_loader.h" 34 #include "ios/chrome/browser/ui/url_loader.h"
35 #include "ios/chrome/grit/ios_strings.h" 35 #include "ios/chrome/grit/ios_strings.h"
36 #import "ios/third_party/material_components_ios/src/components/Snackbar/src/Mat erialSnackbar.h" 36 #import "ios/third_party/material_components_ios/src/components/Snackbar/src/Mat erialSnackbar.h"
37 #include "ios/web/public/referrer.h" 37 #include "ios/web/public/referrer.h"
38 #include "ui/base/l10n/l10n_util.h" 38 #include "ui/base/l10n/l10n_util.h"
39 39
40 using bookmarks::BookmarkModel; 40 using bookmarks::BookmarkModel;
41 using bookmarks::BookmarkNode; 41 using bookmarks::BookmarkNode;
42 42
43 namespace { 43 namespace {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 action.accessibilityIdentifier = @"Edit"; 173 action.accessibilityIdentifier = @"Edit";
174 174
175 NSString* folderTitle = 175 NSString* folderTitle =
176 bookmark_utils_ios::TitleForBookmarkNode(defaultFolder); 176 bookmark_utils_ios::TitleForBookmarkNode(defaultFolder);
177 NSString* text = 177 NSString* text =
178 _browserState->GetPrefs()->GetInt64(prefs::kIosBookmarkFolderDefault) != 178 _browserState->GetPrefs()->GetInt64(prefs::kIosBookmarkFolderDefault) !=
179 kLastUsedFolderNone 179 kLastUsedFolderNone
180 ? l10n_util::GetNSStringF(IDS_IOS_BOOKMARK_PAGE_SAVED_FOLDER, 180 ? l10n_util::GetNSStringF(IDS_IOS_BOOKMARK_PAGE_SAVED_FOLDER,
181 base::SysNSStringToUTF16(folderTitle)) 181 base::SysNSStringToUTF16(folderTitle))
182 : l10n_util::GetNSString(IDS_IOS_BOOKMARK_PAGE_SAVED); 182 : l10n_util::GetNSString(IDS_IOS_BOOKMARK_PAGE_SAVED);
183 TriggerHapticFeedbackForNotification(UINotificationFeedbackTypeSuccess);
183 MDCSnackbarMessage* message = [MDCSnackbarMessage messageWithText:text]; 184 MDCSnackbarMessage* message = [MDCSnackbarMessage messageWithText:text];
184 message.action = action; 185 message.action = action;
185 message.category = bookmark_utils_ios::kBookmarksSnackbarCategory; 186 message.category = bookmark_utils_ios::kBookmarksSnackbarCategory;
186 [MDCSnackbarManager showMessage:message]; 187 [MDCSnackbarManager showMessage:message];
187 } 188 }
188 189
189 - (void)presentBookmarkForTab:(Tab*)tab { 190 - (void)presentBookmarkForTab:(Tab*)tab {
190 DCHECK(!self.bookmarkBrowser && !self.bookmarkEditor); 191 DCHECK(!self.bookmarkBrowser && !self.bookmarkEditor);
191 DCHECK(tab); 192 DCHECK(tab);
192 193
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 } else { 306 } else {
306 [_loader loadURL:url 307 [_loader loadURL:url
307 referrer:web::Referrer() 308 referrer:web::Referrer()
308 transition:ui::PAGE_TRANSITION_AUTO_BOOKMARK 309 transition:ui::PAGE_TRANSITION_AUTO_BOOKMARK
309 rendererInitiated:NO]; 310 rendererInitiated:NO];
310 } 311 }
311 } 312 }
312 } 313 }
313 314
314 @end 315 @end
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/ui/bookmarks/bookmark_utils_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698