blob: 4f3db23da847619d75416de9c2191a1cc4744b4d [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 app_management.mojom;
import "components/services/app_service/public/mojom/types.mojom";
struct App {
string id;
apps.mojom.AppType type;
// The fields below may be omitted because this struct is also used to signal
// updates.
string? title;
string? description;
apps.mojom.OptionalBool is_pinned;
apps.mojom.OptionalBool is_policy_pinned;
string? version;
string? size;
map<uint32, apps.mojom.Permission> permissions;
apps.mojom.InstallSource install_source;
bool hide_more_settings;
bool hide_pin_to_shelf;
bool is_preferred_app;
apps.mojom.WindowMode window_mode;
bool resize_locked;
bool hide_resize_locked;
};
// Extension-based apps primarily use install-time permissions that cannot be
// changed after installation. This struct is used for the page to receive
// string descriptions of those permissions to display to the user.
struct ExtensionAppPermissionMessage {
string message;
array<string> submessages;
};
interface PageHandlerFactory {
CreatePageHandler(pending_remote<Page> page,
pending_receiver<PageHandler> handler);
};
// Browser interface.
interface PageHandler {
GetApps() => (array<App> apps);
GetExtensionAppPermissionMessages(string app_id) =>
(array<ExtensionAppPermissionMessage> messages);
SetPinned(string app_id, apps.mojom.OptionalBool pinned);
SetPermission(string app_id,
apps.mojom.Permission permission);
SetResizeLocked(string app_id, bool locked);
Uninstall(string app_id);
OpenNativeSettings(string app_id);
SetPreferredApp(string app_id, bool is_preferred_app);
};
// Frontend interface.
interface Page {
OnAppAdded(App app);
OnAppChanged(App update);
OnAppRemoved(string app_id);
};
// Permission Type Enums for each App Publisher. The App Publishers are
// required to provide these values so the WebUI can map permission ID to
// permission value.
// This enum shows the ARC permission values currently supported over the
// App Service. It should always match the AppPermission enum in
// app_permissions.mojom
enum ArcPermissionType {
CAMERA = 0,
LOCATION = 1,
MICROPHONE = 2,
NOTIFICATIONS = 3,
CONTACTS = 4,
STORAGE = 5,
};
// This enum takes the important permission values from the
// contents_settings_type.h ContentSettingsType enum.
enum PwaPermissionType {
GEOLOCATION = 4,
NOTIFICATIONS = 5,
MEDIASTREAM_MIC = 8,
MEDIASTREAM_CAMERA = 9,
};
// The Plugin VM app publisher uses this enum directly.
enum PluginVmPermissionType {
PRINTING = 0,
CAMERA = 1,
MICROPHONE = 2,
};