chromium/components/pdf/renderer/pdf_ocr_helper.cc

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

#include "components/pdf/renderer/pdf_ocr_helper.h"

#include "base/metrics/histogram_functions.h"
#include "base/time/time.h"
#include "content/public/renderer/render_frame.h"
#include "pdf/pdf_accessibility_image_fetcher.h"
#include "third_party/blink/public/platform/browser_interface_broker_proxy.h"
#include "ui/accessibility/accessibility_features.h"

namespace pdf {

namespace {

// The delay after which the idle connection to OCR service will be
// disconnected.
constexpr base::TimeDelta kIdleDisconnectDelay =;

}  // namespace

//
// PdfOcrRequest
//
PdfOcrRequest::PdfOcrRequest(const ui::AXNodeID& image_node_id,
                             const chrome_pdf::AccessibilityImageInfo& image,
                             const ui::AXNodeID& root_node_id,
                             const ui::AXNodeID& parent_node_id,
                             const ui::AXNodeID& page_node_id,
                             uint32_t page_index)
    :{}

PdfOcrRequest::PdfOcrRequest(const PdfOcrRequest& other) = default;

//
// PdfOcrHelper
//
PdfOcrHelper::PdfOcrHelper(
    chrome_pdf::PdfAccessibilityImageFetcher* image_fetcher,
    content::RenderFrame& render_frame,
    ui::AXNodeID root_node_id,
    uint32_t page_count,
    OnOcrDataReceivedCallback callback)
    :{}

PdfOcrHelper::~PdfOcrHelper() {}

void PdfOcrHelper::Reset(ui::AXNodeID root_node_id, uint32_t page_count) {}

// static
uint32_t PdfOcrHelper::ComputePagesPerBatch(uint32_t page_count) {}

void PdfOcrHelper::OcrPage(base::queue<PdfOcrRequest> page_requests) {}

bool PdfOcrHelper::AreAllPagesOcred() const {}

bool PdfOcrHelper::AreAllPagesInBatchOcred() const {}

void PdfOcrHelper::SetScreenAIAnnotatorForTesting(
    mojo::PendingRemote<screen_ai::mojom::ScreenAIAnnotator>
        screen_ai_annotator) {}

void PdfOcrHelper::ResetRemainingPageCountForTesting() {}

void PdfOcrHelper::MaybeConnectToOcrService() {}

void PdfOcrHelper::OcrNextImage() {}

void PdfOcrHelper::ReceiveOcrResultsForImage(
    PdfOcrRequest request,
    const ui::AXTreeUpdate& tree_update) {}

}  // namespace pdf