OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_QR_SCANNER_QR_SCANNER_ALERTS_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_QR_SCANNER_QR_SCANNER_ALERTS_H_ |
| 7 |
| 8 #include "ios/chrome/browser/ui/qr_scanner/camera_controller.h" |
| 9 |
| 10 @class UIAlertAction; |
| 11 @class UIAlertController; |
| 12 |
| 13 namespace qr_scanner { |
| 14 |
| 15 // Block type that takes a UIAlertAction. Blocks of this type will be called |
| 16 // when the Cancel button of a UIAlertView is pressed. |
| 17 typedef void (^CancelAlertAction)(UIAlertAction* alertAction); |
| 18 |
| 19 // Returns a dialog to be displayed when the camera state is |state|. |
| 20 // |cancelBlock| is executed when the button to close the dialog is tapped. If |
| 21 // |cancelBlock| is nil, the dialog is dismissed on cancel. |
| 22 UIAlertController* DialogForCameraState(CameraState state, |
| 23 CancelAlertAction cancelBlock); |
| 24 |
| 25 } // namespace qr_scanner |
| 26 |
| 27 #endif // IOS_CHROME_BROWSER_UI_QR_SCANNER_QR_SCANNER_ALERTS_H_ |
OLD | NEW |