chromium/chrome/browser/ui/webui/print_preview/print_preview_utils.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Keys for a dictionary specifying a custom vendor capability. See
// settings/advanced_settings/advanced_settings_item.js in
// chrome/browser/resources/print_preview.
const char kOptionKey[] =;
const char kResetToDefaultKey[] =;
const char kSelectCapKey[] =;
const char kSelectString[] =;
const char kTypeKey[] =;

// TODO(thestig): Consolidate duplicate constants.
const char kDpiCapabilityKey[] =;
const char kHorizontalDpi[] =;
const char kVerticalDpi[] =;
const char kMediaSizeKey[] =;
const char kIsContinuousFeed[] =;

// The dictionary key for the CDD item containing custom vendor capabilities.
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) {}

}  // namespace

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) {}

}  // namespace printing