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

Side by Side Diff: ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.mm

Issue 2680343002: Add haptic feedback for selection change and action trigger. (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 unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/overscroll_actions/overscroll_actions_view.h" 5 #import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.h"
6 6
7 #import <QuartzCore/QuartzCore.h> 7 #import <QuartzCore/QuartzCore.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/objc_property_releaser.h" 10 #include "base/mac/objc_property_releaser.h"
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 self.selectionCircleMaskLayer.transform = 683 self.selectionCircleMaskLayer.transform =
684 self.selectionCircleLayer.transform; 684 self.selectionCircleLayer.transform;
685 } 685 }
686 } else { 686 } else {
687 // Scale selection up. 687 // Scale selection up.
688 self.selectionCircleLayer.transform = CATransform3DMakeScale(1, 1, 1); 688 self.selectionCircleLayer.transform = CATransform3DMakeScale(1, 1, 1);
689 self.selectionCircleMaskLayer.transform = 689 self.selectionCircleMaskLayer.transform =
690 self.selectionCircleLayer.transform; 690 self.selectionCircleLayer.transform;
691 } 691 }
692 [UIView commitAnimations]; 692 [UIView commitAnimations];
693
694 [self.delegate overscrollActionsView:self
695 selectedActionDidChange:self.selectedAction];
693 } 696 }
694 697
695 - (base::scoped_nsobject<NSArray>&)layersToCenterVertically { 698 - (base::scoped_nsobject<NSArray>&)layersToCenterVertically {
696 if (!_layersToCenterVertically) { 699 if (!_layersToCenterVertically) {
697 NSArray* layersToCenterVertically = @[ 700 NSArray* layersToCenterVertically = @[
698 _selectionCircleLayer, _selectionCircleMaskLayer, 701 _selectionCircleLayer, _selectionCircleMaskLayer,
699 _addTabActionImageView.layer, _refreshActionImageView.layer, 702 _addTabActionImageView.layer, _refreshActionImageView.layer,
700 _closeTabActionImageView.layer, _addTabActionImageViewHighlighted.layer, 703 _closeTabActionImageView.layer, _addTabActionImageViewHighlighted.layer,
701 _refreshActionImageViewHighlighted.layer, 704 _refreshActionImageViewHighlighted.layer,
702 _closeTabActionImageViewHighlighted.layer, _backgroundView.layer 705 _closeTabActionImageViewHighlighted.layer, _backgroundView.layer
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 CGPoint tapLocation = [tapRecognizer locationInView:self]; 991 CGPoint tapLocation = [tapRecognizer locationInView:self];
989 OverscrollAction action = [self actionAtLocation:tapLocation]; 992 OverscrollAction action = [self actionAtLocation:tapLocation];
990 if (action != OverscrollAction::NONE) { 993 if (action != OverscrollAction::NONE) {
991 [self updateSelectionForTouchedAction:action]; 994 [self updateSelectionForTouchedAction:action];
992 [self setSelectedAction:action]; 995 [self setSelectedAction:action];
993 [self.delegate overscrollActionsViewDidTapTriggerAction:self]; 996 [self.delegate overscrollActionsViewDidTapTriggerAction:self];
994 } 997 }
995 } 998 }
996 999
997 @end 1000 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/overscroll_actions/overscroll_actions_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698