blob: 8026cb22359768380d9332bfe5ce8ecf66aabb22 [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.
module apps.mojom;
import "ui/gfx/image/mojo/image.mojom";
// Information about an app. See chrome/services/app_service/README.md.
struct App {
AppType app_type;
string app_id;
// The fields above are mandatory. Everything else below is optional.
Readiness readiness;
string? name;
IconKey? icon_key;
OptionalBool show_in_launcher;
// When adding new fields, also update the Merge method and other helpers in
// chrome/services/app_service/public/cpp/app_update.*
};
// The types of apps available in the registry.
enum AppType {
kUnknown = 0,
kArc, // Android app.
kBuiltIn, // Built-in app.
kCrostini, // Linux app.
kExtension, // Extension-backed app.
kWeb, // Web app.
};
// Whether an app is ready to launch, i.e. installed.
enum Readiness {
kUnknown = 0,
kReady, // Installed and launchable.
kDisabledByBlacklist, // Disabled by SafeBrowsing.
kDisabledByPolicy, // Disabled by admin policy.
kDisabledByUser, // Disabled by explicit user action.
kUninstalledByUser,
};
// Augments a bool to include an 'unknown' value.
enum OptionalBool {
kUnknown = 0,
kFalse,
kTrue,
};
enum IconType {
kUnknown,
kExtension,
kResource,
};
struct IconKey {
IconType icon_type;
// The semantics of u_key and s_key depend on the icon_type.
uint64 u_key;
string s_key;
};
enum IconCompression {
kUnknown,
kUncompressed,
kCompressed,
};
struct IconValue {
IconCompression icon_compression;
gfx.mojom.ImageSkia? uncompressed;
array<uint8>? compressed;
};