| OLD | NEW |
| 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/ntp/google_landing_controller.h" | 5 #import "ios/chrome/browser/ui/ntp/google_landing_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
| 10 #import "base/ios/weak_nsobject.h" | 10 #import "base/ios/weak_nsobject.h" |
| (...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1441 action.handler = ^{ | 1441 action.handler = ^{ |
| 1442 base::scoped_nsobject<GoogleLandingController> strongSelf( | 1442 base::scoped_nsobject<GoogleLandingController> strongSelf( |
| 1443 [weakSelf retain]); | 1443 [weakSelf retain]); |
| 1444 if (!strongSelf) | 1444 if (!strongSelf) |
| 1445 return; | 1445 return; |
| 1446 [strongSelf removeBlacklistedURL:net::GURLWithNSURL(_deletedUrl)]; | 1446 [strongSelf removeBlacklistedURL:net::GURLWithNSURL(_deletedUrl)]; |
| 1447 }; | 1447 }; |
| 1448 action.title = l10n_util::GetNSString(IDS_NEW_TAB_UNDO_THUMBNAIL_REMOVE); | 1448 action.title = l10n_util::GetNSString(IDS_NEW_TAB_UNDO_THUMBNAIL_REMOVE); |
| 1449 action.accessibilityIdentifier = @"Undo"; | 1449 action.accessibilityIdentifier = @"Undo"; |
| 1450 | 1450 |
| 1451 TriggerHapticFeedbackForNotification(UINotificationFeedbackTypeSuccess); |
| 1451 MDCSnackbarMessage* message = [MDCSnackbarMessage | 1452 MDCSnackbarMessage* message = [MDCSnackbarMessage |
| 1452 messageWithText:l10n_util::GetNSString( | 1453 messageWithText:l10n_util::GetNSString( |
| 1453 IDS_IOS_NEW_TAB_MOST_VISITED_ITEM_REMOVED)]; | 1454 IDS_IOS_NEW_TAB_MOST_VISITED_ITEM_REMOVED)]; |
| 1454 message.action = action; | 1455 message.action = action; |
| 1455 message.category = @"MostVisitedUndo"; | 1456 message.category = @"MostVisitedUndo"; |
| 1456 [MDCSnackbarManager showMessage:message]; | 1457 [MDCSnackbarManager showMessage:message]; |
| 1457 } | 1458 } |
| 1458 | 1459 |
| 1459 - (void)onPromoLabelTapped { | 1460 - (void)onPromoLabelTapped { |
| 1460 [_focuser cancelOmniboxEdit]; | 1461 [_focuser cancelOmniboxEdit]; |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1741 if (!view) { | 1742 if (!view) { |
| 1742 return nil; | 1743 return nil; |
| 1743 } | 1744 } |
| 1744 if ([view isKindOfClass:aClass]) { | 1745 if ([view isKindOfClass:aClass]) { |
| 1745 return view; | 1746 return view; |
| 1746 } | 1747 } |
| 1747 return [self nearestAncestorOfView:[view superview] withClass:aClass]; | 1748 return [self nearestAncestorOfView:[view superview] withClass:aClass]; |
| 1748 } | 1749 } |
| 1749 | 1750 |
| 1750 @end | 1751 @end |
| OLD | NEW |