Consolidate more printing error dialog code into print_error_dialog.cc.

Move printing error dialog code from print_view_manager_base.cc to
print_error_dialog.cc. Then the combined error dialog implementation
gets the best parts of the two existing implementations and avoids
triggering DCHECK() failures in the message box code.

This also means all dialogs displayed here work with
SetShowPrintErrorDialogForTest(). Printing tests no longer need to
override PrintViewManagerBase code to capture error dialog events.

For Android, remove the error dialog code usage to fix the build. This
improves consistency, plus the error dialog implementation on Android is
a stub anyway.

Bug: 1260167
Change-Id: I94033bdbad3a4c1d159b7e631afb46e8d6ec4257
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4240779
Commit-Queue: Lei Zhang <[email protected]>
Reviewed-by: Alan Screen <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1103969}
diff --git a/chrome/browser/printing/print_error_dialog.h b/chrome/browser/printing/print_error_dialog.h
index 680d277..17c0734 100644
--- a/chrome/browser/printing/print_error_dialog.h
+++ b/chrome/browser/printing/print_error_dialog.h
@@ -7,12 +7,15 @@
 
 #include "base/functional/callback_forward.h"
 
-// Shows a window-modal error that printing failed for some unknown reason.
-void ShowPrintErrorDialog();
+// Shows a window-modal error when a selected printer is invalid.
+void ShowPrintErrorDialogForInvalidPrinterError();
 
-// Provide callback for testing purposes.  Allows test framework to be notified
-// of a printer error dialog event without displaying a window-modal dialog
-// that would block testing completion.  Must be called from the UI thread.
+// Shows a window-modal error when printing failed for some unknown reason.
+void ShowPrintErrorDialogForGenericError();
+
+// Allows tests to override the error dialogs. Instead of displaying a
+// window-modal dialog that can block test completion, runs `callback` instead.
+// Must be called from the UI thread.
 void SetShowPrintErrorDialogForTest(base::RepeatingClosure callback);
 
 #endif  // CHROME_BROWSER_PRINTING_PRINT_ERROR_DIALOG_H_