| Index: ios/chrome/browser/ui/qr_scanner/camera_controller.mm
|
| diff --git a/ios/chrome/browser/ui/qr_scanner/camera_controller.mm b/ios/chrome/browser/ui/qr_scanner/camera_controller.mm
|
| index b4fded5911d07d93f9da8e90dddecf93d1ba29d2..e5ecb321f7a610049114742b4b942920d683406f 100644
|
| --- a/ios/chrome/browser/ui/qr_scanner/camera_controller.mm
|
| +++ b/ios/chrome/browser/ui/qr_scanner/camera_controller.mm
|
| @@ -34,6 +34,10 @@ @interface CameraController ()<AVCaptureMetadataOutputObjectsDelegate> {
|
| @property(nonatomic, readwrite, assign, getter=isTorchAvailable)
|
| BOOL torchAvailable;
|
|
|
| +// Initializes the controller with the |delegate|.
|
| +- (instancetype)initWithDelegate:(id<CameraControllerDelegate>)delegate
|
| + NS_DESIGNATED_INITIALIZER;
|
| +
|
| // YES if |cameraState| is CAMERA_AVAILABLE.
|
| - (BOOL)isCameraAvailable;
|
| // Starts receiving notfications about changes to the capture session and to the
|
| @@ -58,6 +62,13 @@ @implementation CameraController {
|
|
|
| #pragma mark lifecycle
|
|
|
| ++ (instancetype)cameraControllerWithDelegate:
|
| + (id<CameraControllerDelegate>)delegate {
|
| + CameraController* cameraController =
|
| + [[CameraController alloc] initWithDelegate:delegate];
|
| + return cameraController;
|
| +}
|
| +
|
| - (instancetype)initWithDelegate:(id<CameraControllerDelegate>)delegate {
|
| self = [super init];
|
| if (self) {
|
|
|