Avi Drissman | 4a8573c | 2022-09-09 19:35:54 | [diff] [blame] | 1 | // Copyright 2012 The Chromium Authors |
[email protected] | bab4326 | 2012-05-30 19:21:18 | [diff] [blame] | 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 CHROME_BROWSER_PRINTING_PRINT_ERROR_DIALOG_H_ |
| 6 | #define CHROME_BROWSER_PRINTING_PRINT_ERROR_DIALOG_H_ |
[email protected] | bab4326 | 2012-05-30 19:21:18 | [diff] [blame] | 7 | |
Alan Screen | d226030 | 2022-10-27 23:03:47 | [diff] [blame] | 8 | #include "base/functional/callback_forward.h" |
| 9 | |
Lei Zhang | b9d54830 | 2023-02-14 03:09:37 | [diff] [blame] | 10 | // Functions related to showing error dialogs for printing errors. Whether a |
| 11 | // dialog actually appears depends on the platform. Regardless of the platform, |
| 12 | // error dialogs additionally create PRINTER_LOG() entries. |
Lei Zhang | 5207347 | 2023-02-10 23:45:45 | [diff] [blame] | 13 | |
Lei Zhang | 51e06fac | 2023-02-10 19:21:07 | [diff] [blame] | 14 | // Shows a window-modal error when a selected printer is invalid. |
| 15 | void ShowPrintErrorDialogForInvalidPrinterError(); |
[email protected] | bab4326 | 2012-05-30 19:21:18 | [diff] [blame] | 16 | |
Lei Zhang | 51e06fac | 2023-02-10 19:21:07 | [diff] [blame] | 17 | // Shows a window-modal error when printing failed for some unknown reason. |
| 18 | void ShowPrintErrorDialogForGenericError(); |
| 19 | |
| 20 | // Allows tests to override the error dialogs. Instead of displaying a |
| 21 | // window-modal dialog that can block test completion, runs `callback` instead. |
| 22 | // Must be called from the UI thread. |
Alan Screen | d226030 | 2022-10-27 23:03:47 | [diff] [blame] | 23 | void SetShowPrintErrorDialogForTest(base::RepeatingClosure callback); |
| 24 | |
[email protected] | bab4326 | 2012-05-30 19:21:18 | [diff] [blame] | 25 | #endif // CHROME_BROWSER_PRINTING_PRINT_ERROR_DIALOG_H_ |