blob: 3de08819e533c756a4e04f88c89547b1e3ad1e7e [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);
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);
};
// This enum takes the important permission values from the
// contents_settings_type.h ContentSettingsType enum. The App Publisher is
// required to provide these values so the WebUI can map permission ID to
// permission value.
enum PwaPermissionType {
CONTENT_SETTINGS_TYPE_GEOLOCATION = 5,
CONTENT_SETTINGS_TYPE_NOTIFICATIONS = 6,
CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC = 9,
CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA = 10,
};