#include "printing/backend/print_backend_utils.h"
#include <string_view>
#include <vector>
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "printing/buildflags/buildflags.h"
#include "printing/units.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/gfx/geometry/size_f.h"
#if BUILDFLAG(USE_CUPS)
#include "printing/backend/cups_printer.h"
#endif
namespace printing {
namespace {
constexpr float kMmPerInch = …;
constexpr float kMicronsPerInch = …;
constexpr std::string_view kMediaCustomMinPrefix = …;
constexpr std::string_view kMediaCustomMaxPrefix = …;
bool IsValidMediaName(std::string_view& value,
std::vector<std::string_view>& pieces) { … }
std::vector<std::string_view> GetStringPiecesIfValid(std::string_view value) { … }
gfx::Size DimensionsToMicrons(std::string_view value) { … }
}
gfx::Size ParsePaperSize(std::string_view value) { … }
#if BUILDFLAG(USE_CUPS)
gfx::Rect PrintableAreaFromSizeAndPwgMargins(const gfx::Size& size_um,
int bottom_pwg,
int left_pwg,
int right_pwg,
int top_pwg) { … }
void PwgMarginsFromSizeAndPrintableArea(const gfx::Size& size_um,
const gfx::Rect& printable_area_um,
int* bottom_pwg,
int* left_pwg,
int* right_pwg,
int* top_pwg) { … }
#endif
COMPONENT_EXPORT(PRINT_BACKEND)
std::string GetDisplayName(const std::string& printer_name,
std::string_view info) { … }
COMPONENT_EXPORT(PRINT_BACKEND)
std::string_view GetPrinterDescription(std::string_view drv_info,
std::string_view info) { … }
}