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

Unified Diff: ios/chrome/browser/ui/qr_scanner/qr_scanner_view_controller.h

Issue 2589803002: Upstream Chrome on iOS source code [6/11]. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « ios/chrome/browser/ui/qr_scanner/qr_scanner_view.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/qr_scanner/qr_scanner_view_controller.h
diff --git a/ios/chrome/browser/ui/qr_scanner/qr_scanner_view_controller.h b/ios/chrome/browser/ui/qr_scanner/qr_scanner_view_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..95550fc623ab4df3122daae57ad19837374b976e
--- /dev/null
+++ b/ios/chrome/browser/ui/qr_scanner/qr_scanner_view_controller.h
@@ -0,0 +1,46 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_UI_QR_SCANNER_QR_SCANNER_VIEW_CONTROLLER_H_
+#define IOS_CHROME_BROWSER_UI_QR_SCANNER_QR_SCANNER_VIEW_CONTROLLER_H_
+
+#import <UIKit/UIKit.h>
+
+#include "ios/chrome/browser/ui/qr_scanner/camera_controller.h"
+
+@protocol QRScannerViewControllerDelegate
+
+// Called when the scanner detects a valid code. Camera recording is stopped
+// when a result is scanned and the QRScannerViewController is dismissed. This
+// function is called when the dismissal completes. A valid code is any
+// non-empty string. If |load| is YES, the scanned code was of a type which can
+// only encode digits, and the delegate can load the result immediately, instead
+// of prompting the user to confirm the result.
+- (void)receiveQRScannerResult:(NSString*)qrScannerResult
+ loadImmediately:(BOOL)load;
+
+@end
+
+@interface QRScannerViewController : UIViewController<CameraControllerDelegate>
+
+// The delegate which receives the scanned result after the view controller is
+// dismissed.
+@property(nonatomic, assign) id<QRScannerViewControllerDelegate> delegate;
+
+- (instancetype)initWithDelegate:(id<QRScannerViewControllerDelegate>)delegate
+ NS_DESIGNATED_INITIALIZER;
+
+- (instancetype)initWithNibName:(NSString*)name
+ bundle:(NSBundle*)bundle NS_UNAVAILABLE;
+
+- (instancetype)initWithCoder:(NSCoder*)coder NS_UNAVAILABLE;
+
+// Returns a view controller to be presented based on the camera state. Returns
+// |self| if the camera is available or an appropriate UIAlertController if
+// there was an error loading the camera.
+- (UIViewController*)getViewControllerToPresent;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_QR_SCANNER_QR_SCANNER_VIEW_CONTROLLER_H_
« no previous file with comments | « ios/chrome/browser/ui/qr_scanner/qr_scanner_view.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698