2015-03-09 02:37:13 +00: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.
|
|
|
|
|
2018-10-17 18:01:11 +00:00
|
|
|
#ifndef ATOM_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_H_
|
|
|
|
#define ATOM_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_H_
|
2015-03-09 02:37:13 +00:00
|
|
|
|
2017-05-18 22:06:57 +00:00
|
|
|
#include <set>
|
|
|
|
#include <string>
|
|
|
|
|
2016-05-23 01:59:07 +00:00
|
|
|
#include "content/public/browser/browser_context.h"
|
2015-03-09 02:37:13 +00:00
|
|
|
#include "content/public/browser/platform_notification_service.h"
|
|
|
|
|
2018-10-17 18:01:11 +00:00
|
|
|
namespace atom {
|
2015-03-09 02:37:13 +00:00
|
|
|
|
2018-10-17 18:01:11 +00:00
|
|
|
class AtomBrowserClient;
|
2015-03-09 02:37:13 +00:00
|
|
|
|
2015-12-24 14:20:47 +00:00
|
|
|
class PlatformNotificationService
|
2015-03-09 02:37:13 +00:00
|
|
|
: public content::PlatformNotificationService {
|
|
|
|
public:
|
2018-10-17 18:01:11 +00:00
|
|
|
explicit PlatformNotificationService(AtomBrowserClient* browser_client);
|
2015-12-24 14:20:47 +00:00
|
|
|
~PlatformNotificationService() override;
|
2015-03-09 02:37:13 +00:00
|
|
|
|
2015-12-24 14:20:47 +00:00
|
|
|
protected:
|
2015-03-09 02:37:13 +00:00
|
|
|
// content::PlatformNotificationService:
|
2017-01-23 08:48:16 +00:00
|
|
|
void DisplayNotification(
|
2018-10-05 21:24:38 +00:00
|
|
|
content::RenderProcessHost* render_process_host,
|
2017-01-23 08:48:16 +00:00
|
|
|
content::BrowserContext* browser_context,
|
|
|
|
const std::string& notification_id,
|
2015-03-09 02:37:13 +00:00
|
|
|
const GURL& origin,
|
2019-01-12 01:00:43 +00:00
|
|
|
const blink::PlatformNotificationData& notification_data,
|
|
|
|
const blink::NotificationResources& notification_resources) override;
|
2015-04-21 10:54:57 +00:00
|
|
|
void DisplayPersistentNotification(
|
2015-03-09 02:37:13 +00:00
|
|
|
content::BrowserContext* browser_context,
|
2017-01-23 08:48:16 +00:00
|
|
|
const std::string& notification_id,
|
|
|
|
const GURL& service_worker_scope,
|
2015-03-09 02:37:13 +00:00
|
|
|
const GURL& origin,
|
2019-01-12 01:00:43 +00:00
|
|
|
const blink::PlatformNotificationData& notification_data,
|
|
|
|
const blink::NotificationResources& notification_resources) override;
|
2017-01-23 08:48:16 +00:00
|
|
|
void ClosePersistentNotification(content::BrowserContext* browser_context,
|
|
|
|
const std::string& notification_id) override;
|
2018-04-08 19:24:08 +00:00
|
|
|
void CloseNotification(content::BrowserContext* browser_context,
|
|
|
|
const std::string& notification_id) override;
|
2017-06-16 21:48:59 +00:00
|
|
|
void GetDisplayedNotifications(
|
2015-07-23 06:53:42 +00:00
|
|
|
content::BrowserContext* browser_context,
|
2019-02-21 07:50:18 +00:00
|
|
|
DisplayedNotificationsCallback callback) override;
|
2018-10-02 20:52:21 +00:00
|
|
|
int64_t ReadNextPersistentNotificationId(
|
|
|
|
content::BrowserContext* browser_context) override;
|
2018-10-25 17:19:44 +00:00
|
|
|
void RecordNotificationUkmEvent(
|
|
|
|
content::BrowserContext* browser_context,
|
|
|
|
const content::NotificationDatabaseData& data) override;
|
2019-03-22 03:25:48 +00:00
|
|
|
void ScheduleTrigger(content::BrowserContext* browser_context,
|
|
|
|
base::Time timestamp) override;
|
|
|
|
base::Time ReadNextTriggerTimestamp(
|
|
|
|
content::BrowserContext* browser_context) override;
|
2015-03-09 02:37:13 +00:00
|
|
|
|
2015-12-24 14:20:47 +00:00
|
|
|
private:
|
2018-10-17 18:01:11 +00:00
|
|
|
AtomBrowserClient* browser_client_;
|
2015-03-09 02:37:13 +00:00
|
|
|
|
2015-12-24 14:20:47 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(PlatformNotificationService);
|
2015-03-09 02:37:13 +00:00
|
|
|
};
|
|
|
|
|
2018-10-17 18:01:11 +00:00
|
|
|
} // namespace atom
|
2015-03-09 02:37:13 +00:00
|
|
|
|
2018-10-17 18:01:11 +00:00
|
|
|
#endif // ATOM_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_H_
|