| Index: third_party/WebKit/public/platform/modules/notifications/notification_service.mojom
|
| diff --git a/third_party/WebKit/public/platform/modules/notifications/notification_service.mojom b/third_party/WebKit/public/platform/modules/notifications/notification_service.mojom
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c33bb9f570e7433144d444f83005ae07c27588ed
|
| --- /dev/null
|
| +++ b/third_party/WebKit/public/platform/modules/notifications/notification_service.mojom
|
| @@ -0,0 +1,54 @@
|
| +// Copyright 2016 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 blink.mojom;
|
| +
|
| +import "third_party/WebKit/public/platform/modules/notifications/notification.mojom";
|
| +import "third_party/WebKit/public/platform/modules/notifications/notification_resources.mojom";
|
| +import "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom";
|
| +
|
| +enum NotificationDisplayResult {
|
| + FAILED_STORAGE_ERROR,
|
| + SUCCESS
|
| +};
|
| +
|
| +enum NotificationCloseResult {
|
| + CLOSED,
|
| + NOT_FOUND
|
| +};
|
| +
|
| +// Service through which Blink can request notifications to be shown, closed or
|
| +// retrieved from the embedder.
|
| +interface NotificationService {
|
| + // Synchronously retrieves the permission status for |origin|. Required to
|
| + // be synchronous due to the Notification.permission JavaScript getter.
|
| + [Sync] GetPermissionStatus(string origin) => (PermissionStatus status);
|
| +
|
| + // Displays the non-persistent |notification| for |origin|, to be decorated
|
| + // with the |resources| when requested by the developer. The |client| will be
|
| + // informed when the notification was closed by the user.
|
| + Display(string origin, Notification notification, NotificationResources resources, NotificationClient client)
|
| + => (NotificationDisplayResult result, string id);
|
| +
|
| + // Displays the persistent |notification| for |origin|, to be decorated with
|
| + // the |resources| when requested by the developer.
|
| + DisplayPersistent(string origin, int64 service_worker_registration_id, Notification notification, NotificationResources resources)
|
| + => (NotificationDisplayResult result);
|
| +
|
| + // Gets an array with the showing persistent notifications for |origin|,
|
| + // optionally filtered by the |tag|.
|
| + GetNotifications(string origin, int64 service_worker_registration_id, string tag)
|
| + => (array<Notification> notifications);
|
| +
|
| + // Closes the notification identified by |id| belonging to |origin|.
|
| + Close(string origin, string id)
|
| + => (NotificationCloseResult result);
|
| +};
|
| +
|
| +// Defines a client of a non-persistent notification that is to be informed of
|
| +// user interactions of the associated notification.
|
| +interface NotificationClient {
|
| + OnClick();
|
| + OnClose(NotificationCloseResult result);
|
| +};
|
|
|