blob: cfad5cba531156f90dff43ae9198261882c568d5 [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 "chrome/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;
string? version;
string? size;
map<uint32, apps.mojom.Permission> permissions;
};
// 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(Page page, 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);
Uninstall(string app_id);
OpenNativeSettings(string app_id);
};
// 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,
};
// This enum takes the important permission values from the
// contents_settings_type.h ContentSettingsType enum.
enum PwaPermissionType {
CONTENT_SETTINGS_TYPE_GEOLOCATION = 5,
CONTENT_SETTINGS_TYPE_NOTIFICATIONS = 6,
CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC = 9,
CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA = 10,
};