chromium/components/page_image_annotation/content/renderer/content_page_annotator_driver.cc

// Copyright 2019 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/page_image_annotation/content/renderer/content_page_annotator_driver.h"

#include <optional>

#include "base/base64.h"
#include "base/functional/bind.h"
#include "base/task/single_thread_task_runner.h"
#include "content/public/renderer/render_frame.h"
#include "crypto/sha2.h"
#include "services/image_annotation/public/mojom/image_annotation.mojom.h"
#include "third_party/blink/public/platform/browser_interface_broker_proxy.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/public/web/web_node.h"

namespace page_image_annotation {

namespace {

ia_mojom;

// The number of milliseconds to wait before traversing the DOM to find image
// elements.
constexpr int kDomCrawlDelayMs =;

// Attempts to produce image metadata for the given element. Will produce a null
// value if the element has a missing or malformed src attribute.
std::optional<PageAnnotator::ImageMetadata> ProduceMetadata(
    const GURL& page_url,
    const blink::WebElement element,
    const uint64_t node_id) {}

mojo::PendingRemote<ia_mojom::Annotator> RequestAnnotator(
    content::RenderFrame* const render_frame) {}

}  // namespace

ContentPageAnnotatorDriver::ContentPageAnnotatorDriver(
    content::RenderFrame* const render_frame)
    :{}

ContentPageAnnotatorDriver::~ContentPageAnnotatorDriver() {}

// static
ContentPageAnnotatorDriver* ContentPageAnnotatorDriver::GetOrCreate(
    content::RenderFrame* const render_frame) {}

PageAnnotator& ContentPageAnnotatorDriver::GetPageAnnotator() {}

blink::WebElement ContentPageAnnotatorDriver::GetElement(
    const uint64_t node_id) {}

// static
std::string ContentPageAnnotatorDriver::GenerateSourceId(
    const GURL& page_url,
    const std::string& uri_fragment) {}

void ContentPageAnnotatorDriver::DidDispatchDOMContentLoadedEvent() {}

void ContentPageAnnotatorDriver::OnDestruct() {}

void ContentPageAnnotatorDriver::FindImages(const GURL& page_url,
                                            blink::WebElement element) {}

void ContentPageAnnotatorDriver::FindAndTrackImages() {}

SkBitmap ContentPageAnnotatorDriver::GetBitmapForId(const uint64_t node_id) {}

}  // namespace page_image_annotation