blob: 31f005dea917312dfaa916913a1dc4cdad4d4ff9 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
#include "base/callback.h"
namespace gfx {
class Image;
namespace offline_pages {
// Decodes thumbnails. Provided so that this component does not need to
// depend on ImageSkiaOperations which isn't available everywhere.
class ThumbnailDecoder {
using DecodeComplete = base::OnceCallback<void(const gfx::Image&)>;
virtual ~ThumbnailDecoder() {}
// Decode a thumbnail image and crop it square. Calls complete_callback
// when decoding completes successfully or otherwise. If decoding fails,
// the returned image is empty.
virtual void DecodeAndCropThumbnail(const std::string& thumbnail_data,
DecodeComplete complete_callback) = 0;
} // namespace offline_pages