blob: 7e46b1907801912ac194a278066d073acc2864dc [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;
};
interface PageHandlerFactory {
CreatePageHandler(Page page, PageHandler& handler);
};
// Browser interface.
interface PageHandler {
GetApps() => (array<App> apps);
SetPermission(string app_id,
apps.mojom.Permission permission);
};
// 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,
};