blob: 548f9f6eb1a2152da30b873d1ae60b1847f68a4b [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;
// 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;
OptionalBool show_in_launcher;
// TODO: add more fields, e.g. icon_key.
// 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.
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,
};
// Whether an app is preferred by the user, e.g. for capturing links within
// its scope. Multiple preferred apps with overlapping scope may be set, and
// the best choice will be resolved via the most specific scope.
enum AppPreferred {
// No preference currently saved.
kUnknown,
kPreferred,
kNotPreferred,
};
// A struct representing an app.
//
// Deprecated: use App instead. See chrome/services/app_service/README.md.
struct AppInfo {
// The id of the app. For backwards compabitility, this should currently be
// the same as the extension ID that would have been generated for the app.
string id;
// The type of the app.
AppType type;
// The app's current preferred state.
AppPreferred preferred;
};