2015-03-08 19:37:13 -07:00
|
|
|
// Copyright (c) 2015 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-CHROMIUM file.
|
|
|
|
|
2019-06-19 13:56:58 -07:00
|
|
|
#ifndef SHELL_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_H_
|
|
|
|
#define SHELL_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_H_
|
2015-03-08 19:37:13 -07:00
|
|
|
|
2017-05-18 15:06:57 -07:00
|
|
|
#include <string>
|
|
|
|
|
2015-03-08 19:37:13 -07:00
|
|
|
#include "content/public/browser/platform_notification_service.h"
|
|
|
|
|
2019-06-19 14:23:04 -07:00
|
|
|
namespace electron {
|
2015-03-08 19:37:13 -07:00
|
|
|
|
2020-02-04 12:19:40 -08:00
|
|
|
class ElectronBrowserClient;
|
2015-03-08 19:37:13 -07:00
|
|
|
|
2015-12-24 22:20:47 +08:00
|
|
|
class PlatformNotificationService
|
2015-03-08 19:37:13 -07:00
|
|
|
: public content::PlatformNotificationService {
|
|
|
|
public:
|
2020-02-04 12:19:40 -08:00
|
|
|
explicit PlatformNotificationService(ElectronBrowserClient* browser_client);
|
2015-12-24 22:20:47 +08:00
|
|
|
~PlatformNotificationService() override;
|
2015-03-08 19:37:13 -07:00
|
|
|
|
2015-12-24 22:20:47 +08:00
|
|
|
protected:
|
2015-03-08 19:37:13 -07:00
|
|
|
// content::PlatformNotificationService:
|
2017-01-23 17:48:16 +09:00
|
|
|
void DisplayNotification(
|
2021-04-29 11:23:28 -07:00
|
|
|
content::RenderFrameHost* render_frame_host,
|
2017-01-23 17:48:16 +09:00
|
|
|
const std::string& notification_id,
|
2015-03-08 19:37:13 -07:00
|
|
|
const GURL& origin,
|
2021-04-27 14:27:34 -07:00
|
|
|
const GURL& document_url,
|
2019-01-12 06:30:43 +05:30
|
|
|
const blink::PlatformNotificationData& notification_data,
|
|
|
|
const blink::NotificationResources& notification_resources) override;
|
2015-04-21 18:54:57 +08:00
|
|
|
void DisplayPersistentNotification(
|
2017-01-23 17:48:16 +09:00
|
|
|
const std::string& notification_id,
|
|
|
|
const GURL& service_worker_scope,
|
2015-03-08 19:37:13 -07:00
|
|
|
const GURL& origin,
|
2019-01-12 06:30:43 +05:30
|
|
|
const blink::PlatformNotificationData& notification_data,
|
|
|
|
const blink::NotificationResources& notification_resources) override;
|
2019-04-20 13:20:37 -04:00
|
|
|
void ClosePersistentNotification(const std::string& notification_id) override;
|
|
|
|
void CloseNotification(const std::string& notification_id) override;
|
2017-06-17 00:48:59 +03:00
|
|
|
void GetDisplayedNotifications(
|
2019-02-21 13:20:18 +05:30
|
|
|
DisplayedNotificationsCallback callback) override;
|
2019-04-20 13:20:37 -04:00
|
|
|
int64_t ReadNextPersistentNotificationId() override;
|
2018-10-25 22:49:44 +05:30
|
|
|
void RecordNotificationUkmEvent(
|
|
|
|
const content::NotificationDatabaseData& data) override;
|
2019-04-20 13:20:37 -04:00
|
|
|
void ScheduleTrigger(base::Time timestamp) override;
|
|
|
|
base::Time ReadNextTriggerTimestamp() override;
|
2015-03-08 19:37:13 -07:00
|
|
|
|
2015-12-24 22:20:47 +08:00
|
|
|
private:
|
2020-02-04 12:19:40 -08:00
|
|
|
ElectronBrowserClient* browser_client_;
|
2015-03-08 19:37:13 -07:00
|
|
|
|
2015-12-24 22:20:47 +08:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(PlatformNotificationService);
|
2015-03-08 19:37:13 -07:00
|
|
|
};
|
|
|
|
|
2019-06-19 14:23:04 -07:00
|
|
|
} // namespace electron
|
2015-03-08 19:37:13 -07:00
|
|
|
|
2019-06-19 13:56:58 -07:00
|
|
|
#endif // SHELL_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_H_
|