Index: ios/chrome/browser/ui/qr_scanner/qr_scanner_alerts.h |
diff --git a/ios/chrome/browser/ui/qr_scanner/qr_scanner_alerts.h b/ios/chrome/browser/ui/qr_scanner/qr_scanner_alerts.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0b9585da60be083f5010d6ae19f914cce7609ff2 |
--- /dev/null |
+++ b/ios/chrome/browser/ui/qr_scanner/qr_scanner_alerts.h |
@@ -0,0 +1,27 @@ |
+// 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_ALERTS_H_ |
+#define IOS_CHROME_BROWSER_UI_QR_SCANNER_QR_SCANNER_ALERTS_H_ |
+ |
+#include "ios/chrome/browser/ui/qr_scanner/camera_controller.h" |
+ |
+@class UIAlertAction; |
+@class UIAlertController; |
+ |
+namespace qr_scanner { |
+ |
+// Block type that takes a UIAlertAction. Blocks of this type will be called |
+// when the Cancel button of a UIAlertView is pressed. |
+typedef void (^CancelAlertAction)(UIAlertAction* alertAction); |
+ |
+// Returns a dialog to be displayed when the camera state is |state|. |
+// |cancelBlock| is executed when the button to close the dialog is tapped. If |
+// |cancelBlock| is nil, the dialog is dismissed on cancel. |
+UIAlertController* DialogForCameraState(CameraState state, |
+ CancelAlertAction cancelBlock); |
+ |
+} // namespace qr_scanner |
+ |
+#endif // IOS_CHROME_BROWSER_UI_QR_SCANNER_QR_SCANNER_ALERTS_H_ |