chromium/chrome/browser/companion/visual_query/visual_query_classifier_host.cc

// Copyright 2023 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/companion/visual_query/visual_query_classifier_host.h"

#include <optional>
#include <string_view>

#include "base/base64.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros_local.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/companion/core/companion_metrics_logger.h"
#include "chrome/browser/companion/visual_query/visual_query_suggestions_service.h"
#include "content/public/browser/render_frame_host.h"
#include "mojo/public/cpp/base/proto_wrapper.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/encode/SkJpegEncoder.h"
#include "ui/gfx/image/buffer_w_stream.h"
#include "ui/gfx/image/image_skia.h"
#include "url/gurl.h"

namespace companion::visual_query {

namespace {

void RecordStatusChange(InitStatus status) {}

std::optional<std::string> Base64EncodeBitmap(const SkBitmap& bitmap) {}

// Close the provided model file.
void CloseModelFile(base::File model_file) {}

// Convert metrics map from Mojom IPC to |VisualSuggestionMetrics|.
VisualSuggestionsMetrics GenerateMetrics(const ClassificationStats& stats) {}

}  // namespace

VisualQueryClassifierHost::VisualQueryClassifierHost(
    VisualQuerySuggestionsService* visual_query_service)
    :{}

VisualQueryClassifierHost::~VisualQueryClassifierHost() = default;

void VisualQueryClassifierHost::HandleClassification(
    std::vector<mojom::VisualQuerySuggestionPtr> results,
    mojom::ClassificationStatsPtr classification_stats) {}

void VisualQueryClassifierHost::StartClassification(
    content::RenderFrameHost* render_frame_host,
    const GURL& validated_url,
    ResultCallback callback) {}

void VisualQueryClassifierHost::StartClassificationWithModel(
    mojo::AssociatedRemote<mojom::VisualSuggestionsRequestHandler> visual_query,
    base::File model,
    std::optional<mojo_base::ProtoWrapper> wrapped_config) {}

void VisualQueryClassifierHost::CancelClassification(const GURL& visible_url) {}

std::optional<VisualSuggestionsResults>
VisualQueryClassifierHost::GetVisualResult(const GURL& url) {}
}  // namespace companion::visual_query