| 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 #ifndef IOS_CHROME_BROWSER_UI_QR_SCANNER_CAMERA_CONTROLLER_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_QR_SCANNER_CAMERA_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_QR_SCANNER_CAMERA_CONTROLLER_H_ | 6 #define IOS_CHROME_BROWSER_UI_QR_SCANNER_CAMERA_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <AVFoundation/AVFoundation.h> | 8 #import <AVFoundation/AVFoundation.h> |
| 9 #import <UIKit/UIKit.h> | 9 #import <UIKit/UIKit.h> |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 // The CameraController manages the AVCaptureSession, its inputs, outputs, and | 61 // The CameraController manages the AVCaptureSession, its inputs, outputs, and |
| 62 // notifications for the QRScannerViewController. | 62 // notifications for the QRScannerViewController. |
| 63 @interface CameraController : NSObject | 63 @interface CameraController : NSObject |
| 64 | 64 |
| 65 // The current state of the torch. | 65 // The current state of the torch. |
| 66 @property(nonatomic, readonly, assign, getter=isTorchActive) BOOL torchActive; | 66 @property(nonatomic, readonly, assign, getter=isTorchActive) BOOL torchActive; |
| 67 | 67 |
| 68 - (instancetype)init NS_UNAVAILABLE; | 68 - (instancetype)init NS_UNAVAILABLE; |
| 69 | 69 |
| 70 // Initializes the controller with the |delegate|. | 70 // Returns a new controller with the |delegate|. |
| 71 - (instancetype)initWithDelegate:(id<CameraControllerDelegate>)delegate | 71 + (instancetype)cameraControllerWithDelegate: |
| 72 NS_DESIGNATED_INITIALIZER; | 72 (id<CameraControllerDelegate>)delegate; |
| 73 | 73 |
| 74 // Returns the app's authorization in regards to the camera. | 74 // Returns the app's authorization in regards to the camera. |
| 75 - (AVAuthorizationStatus)getAuthorizationStatus; | 75 - (AVAuthorizationStatus)getAuthorizationStatus; |
| 76 | 76 |
| 77 // Asks the user to grant the authorization to access the camera. | 77 // Asks the user to grant the authorization to access the camera. |
| 78 // Should only be called when the current authorization status is | 78 // Should only be called when the current authorization status is |
| 79 // AVAuthorizationStatusNotDetermined. | 79 // AVAuthorizationStatusNotDetermined. |
| 80 - (void)requestAuthorizationAndLoadCaptureSession: | 80 - (void)requestAuthorizationAndLoadCaptureSession: |
| 81 (AVCaptureVideoPreviewLayer*)previewLayer; | 81 (AVCaptureVideoPreviewLayer*)previewLayer; |
| 82 | 82 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 101 // available. | 101 // available. |
| 102 - (void)stopRecording; | 102 - (void)stopRecording; |
| 103 | 103 |
| 104 // Sets the camera's torch mode to |mode|. Does nothing if the camera is not | 104 // Sets the camera's torch mode to |mode|. Does nothing if the camera is not |
| 105 // available or the torch mode is not supported. | 105 // available or the torch mode is not supported. |
| 106 - (void)setTorchMode:(AVCaptureTorchMode)mode; | 106 - (void)setTorchMode:(AVCaptureTorchMode)mode; |
| 107 | 107 |
| 108 @end | 108 @end |
| 109 | 109 |
| 110 #endif // IOS_CHROME_BROWSER_UI_QR_SCANNER_CAMERA_CONTROLLER_H_ | 110 #endif // IOS_CHROME_BROWSER_UI_QR_SCANNER_CAMERA_CONTROLLER_H_ |
| OLD | NEW |