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.
|
|
|
|
|
2017-05-18 15:05:25 -07:00
|
|
|
#ifndef BRIGHTRAY_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_
|
|
|
|
#define BRIGHTRAY_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_
|
2015-03-08 19:37:13 -07:00
|
|
|
|
2017-05-18 15:06:57 -07:00
|
|
|
#include <set>
|
|
|
|
#include <string>
|
|
|
|
|
2016-05-23 10:59:07 +09:00
|
|
|
#include "content/public/browser/browser_context.h"
|
2015-03-08 19:37:13 -07:00
|
|
|
#include "content/public/browser/platform_notification_service.h"
|
|
|
|
|
|
|
|
namespace brightray {
|
|
|
|
|
2015-12-24 22:20:47 +08:00
|
|
|
class BrowserClient;
|
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:
|
2015-12-24 22:20:47 +08:00
|
|
|
explicit PlatformNotificationService(BrowserClient* browser_client);
|
|
|
|
~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(
|
2018-10-05 14:24:38 -07:00
|
|
|
content::RenderProcessHost* render_process_host,
|
2017-01-23 17:48:16 +09:00
|
|
|
content::BrowserContext* browser_context,
|
|
|
|
const std::string& notification_id,
|
2015-03-08 19:37:13 -07:00
|
|
|
const GURL& origin,
|
|
|
|
const content::PlatformNotificationData& notification_data,
|
2018-04-09 00:54:08 +05:30
|
|
|
const content::NotificationResources& notification_resources) override;
|
2015-04-21 18:54:57 +08:00
|
|
|
void DisplayPersistentNotification(
|
2015-03-08 19:37:13 -07:00
|
|
|
content::BrowserContext* browser_context,
|
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,
|
2016-04-26 22:52:26 -04:00
|
|
|
const content::PlatformNotificationData& notification_data,
|
|
|
|
const content::NotificationResources& notification_resources) override;
|
2017-01-23 17:48:16 +09:00
|
|
|
void ClosePersistentNotification(content::BrowserContext* browser_context,
|
|
|
|
const std::string& notification_id) override;
|
2018-04-09 00:54:08 +05:30
|
|
|
void CloseNotification(content::BrowserContext* browser_context,
|
|
|
|
const std::string& notification_id) override;
|
2017-06-17 00:48:59 +03:00
|
|
|
void GetDisplayedNotifications(
|
2015-07-23 14:53:42 +08:00
|
|
|
content::BrowserContext* browser_context,
|
2017-06-17 00:48:59 +03:00
|
|
|
const DisplayedNotificationsCallback& callback) override;
|
2018-10-02 13:52:21 -07:00
|
|
|
int64_t ReadNextPersistentNotificationId(
|
|
|
|
content::BrowserContext* browser_context) override;
|
2015-03-08 19:37:13 -07:00
|
|
|
|
2015-12-24 22:20:47 +08:00
|
|
|
private:
|
|
|
|
BrowserClient* 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
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace brightray
|
|
|
|
|
2017-05-18 15:05:25 -07:00
|
|
|
#endif // BRIGHTRAY_BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_
|