#include "chrome/browser/ui/webui/print_preview/print_preview_utils.h"
#include <string>
#include <utility>
#include "base/check.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/memory/ref_counted_memory.h"
#include "base/threading/thread_restrictions.h"
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/printing/print_preview_dialog_controller.h"
#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/ui/webui/print_preview/printer_handler.h"
#include "chrome/common/printing/printer_capabilities.h"
#include "components/crash/core/common/crash_keys.h"
#include "content/public/browser/render_frame_host.h"
#include "printing/backend/print_backend_consts.h"
#include "printing/page_range.h"
#include "printing/print_job_constants.h"
#include "printing/units.h"
namespace printing {
const char kOptionKey[] = …;
const char kResetToDefaultKey[] = …;
const char kSelectCapKey[] = …;
const char kSelectString[] = …;
const char kTypeKey[] = …;
const char kDpiCapabilityKey[] = …;
const char kHorizontalDpi[] = …;
const char kVerticalDpi[] = …;
const char kMediaSizeKey[] = …;
const char kIsContinuousFeed[] = …;
const char kVendorCapabilityKey[] = …;
namespace {
base::Value::List PrintersToValues(const PrinterList& printer_list) { … }
template <typename Predicate>
base::Value::List GetFilteredList(const base::Value::List& list,
Predicate pred) { … }
bool ValueIsNull(const base::Value& val) { … }
bool DpiCapabilityInvalid(const base::Value& val) { … }
bool VendorCapabilityInvalid(const base::Value& val) { … }
void SystemDialogDone(const base::Value& error) { … }
}
base::Value::Dict ValidateCddForPrintPreview(base::Value::Dict cdd) { … }
base::Value::Dict UpdateCddWithDpiIfMissing(base::Value::Dict cdd) { … }
const base::Value::List* GetMediaSizeOptionsFromCdd(
const base::Value::Dict& cdd) { … }
void FilterContinuousFeedMediaSizes(base::Value::Dict& cdd) { … }
void ConvertPrinterListForCallback(
PrinterHandler::AddedPrintersCallback callback,
PrinterHandler::GetPrintersDoneCallback done_callback,
const PrinterList& printer_list) { … }
void StartLocalPrint(base::Value::Dict job_settings,
scoped_refptr<base::RefCountedMemory> print_data,
content::WebContents* preview_web_contents,
PrinterHandler::PrintCallback callback) { … }
}