chromium/chrome/services/util_win/public/mojom/util_read_icon.mojom

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

module chrome.mojom;

import "mojo/public/mojom/base/read_only_file.mojom";
import "sandbox/policy/mojom/sandbox.mojom";
import "ui/gfx/image/mojom/image.mojom";

// Correspond to SHGFI_*ICON.
enum IconSize {
  kSmall,
  kNormal,
  kLarge,
};

// Utility process interface exposed to the browser process on OS_WIN. Allows
// for sandboxing when reading icons from downloaded files.
[ServiceSandbox=sandbox.mojom.Sandbox.kIconReader]
interface UtilReadIcon {
  // Reads the primary icon from |file| with the scaling factor |scale|
  // using |size| as a hint.
  ReadIcon(mojo_base.mojom.ReadOnlyFile file, IconSize size, float scale) =>
      (gfx.mojom.ImageSkia? icon);
};