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

Unified Diff: ios/chrome/browser/ui/qr_scanner/camera_controller.mm

Issue 2912373002: [iOS] Stop swizzling the |init| method of CameraController. (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
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) {
« no previous file with comments | « ios/chrome/browser/ui/qr_scanner/camera_controller.h ('k') | ios/chrome/browser/ui/qr_scanner/qr_scanner_view_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698