| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/qr_scanner/qr_scanner_view.h" | 5 #import "ios/chrome/browser/ui/qr_scanner/qr_scanner_view.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/mac/foundation_util.h" | 8 #include "base/mac/foundation_util.h" |
| 9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #include "ios/chrome/browser/ui/icons/chrome_icon.h" | 10 #include "ios/chrome/browser/ui/icons/chrome_icon.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 const CGFloat kViewportBorderCornerRadius = 2.0; | 34 const CGFloat kViewportBorderCornerRadius = 2.0; |
| 35 // Line width of the viewport border. | 35 // Line width of the viewport border. |
| 36 const CGFloat kViewportBorderLineWidth = 4.0; | 36 const CGFloat kViewportBorderLineWidth = 4.0; |
| 37 // Shadow opacity of the viewport border. | 37 // Shadow opacity of the viewport border. |
| 38 const CGFloat kViewportBorderShadowOpacity = 1.0; | 38 const CGFloat kViewportBorderShadowOpacity = 1.0; |
| 39 // Shadow radius of the viewport border. | 39 // Shadow radius of the viewport border. |
| 40 const CGFloat kViewportBorderShadowRadius = 10.0; | 40 const CGFloat kViewportBorderShadowRadius = 10.0; |
| 41 // Padding of the viewport caption, below the viewport. | 41 // Padding of the viewport caption, below the viewport. |
| 42 const CGFloat kViewportCaptionVerticalPadding = 14.0; | 42 const CGFloat kViewportCaptionVerticalPadding = 14.0; |
| 43 // Padding of the viewport caption from the edges of the superview. | 43 // Padding of the viewport caption from the edges of the superview. |
| 44 const CGFloat kViewportCaptionHorizontalPadding = 20.0; | 44 const CGFloat kViewportCaptionHorizontalPadding = 31.0; |
| 45 // Shadow opacity of the viewport caption. | 45 // Shadow opacity of the viewport caption. |
| 46 const CGFloat kViewportCaptionShadowOpacity = 1.0; | 46 const CGFloat kViewportCaptionShadowOpacity = 1.0; |
| 47 // Shadow radius of the viewport caption. | 47 // Shadow radius of the viewport caption. |
| 48 const CGFloat kViewportCaptionShadowRadius = 5.0; | 48 const CGFloat kViewportCaptionShadowRadius = 5.0; |
| 49 | 49 |
| 50 // Duration of the flash animation played when a code is scanned. | 50 // Duration of the flash animation played when a code is scanned. |
| 51 const CGFloat kFlashDuration = 0.5; | 51 const CGFloat kFlashDuration = 0.5; |
| 52 | 52 |
| 53 // Returns a square of size |rectSize| centered inside |frameSize|. | 53 // Returns a square of size |rectSize| centered inside |frameSize|. |
| 54 CGRect CenteredRectForViewport(CGSize frameSize, CGFloat rectSize) { | 54 CGRect CenteredRectForViewport(CGSize frameSize, CGFloat rectSize) { |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 [NSLayoutConstraint activateConstraints:@[ | 539 [NSLayoutConstraint activateConstraints:@[ |
| 540 [[_previewOverlay centerXAnchor] | 540 [[_previewOverlay centerXAnchor] |
| 541 constraintEqualToAnchor:[self centerXAnchor]], | 541 constraintEqualToAnchor:[self centerXAnchor]], |
| 542 [[_previewOverlay centerYAnchor] | 542 [[_previewOverlay centerYAnchor] |
| 543 constraintEqualToAnchor:[self centerYAnchor]], | 543 constraintEqualToAnchor:[self centerYAnchor]], |
| 544 _overlaySquareConstraint, _overlayWidthConstraint, _overlayHeightConstraint | 544 _overlaySquareConstraint, _overlayWidthConstraint, _overlayHeightConstraint |
| 545 ]]; | 545 ]]; |
| 546 } | 546 } |
| 547 | 547 |
| 548 @end | 548 @end |
| OLD | NEW |