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.
|
|
|
|
|
2015-12-24 14:20:47 +00:00
|
|
|
#ifndef BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_
|
|
|
|
#define BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_
|
2015-03-09 02:37:13 +00:00
|
|
|
|
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"
|
|
|
|
|
|
|
|
namespace brightray {
|
|
|
|
|
2015-12-24 14:20:47 +00:00
|
|
|
class BrowserClient;
|
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:
|
2015-12-24 14:20:47 +00:00
|
|
|
explicit PlatformNotificationService(BrowserClient* browser_client);
|
|
|
|
~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:
|
2016-07-04 06:06:05 +00:00
|
|
|
blink::mojom::PermissionStatus CheckPermissionOnUIThread(
|
2015-04-21 10:54:57 +00:00
|
|
|
content::BrowserContext* browser_context,
|
|
|
|
const GURL& origin,
|
|
|
|
int render_process_id) override;
|
2016-07-04 06:06:05 +00:00
|
|
|
blink::mojom::PermissionStatus CheckPermissionOnIOThread(
|
2015-03-09 02:37:13 +00:00
|
|
|
content::ResourceContext* resource_context,
|
|
|
|
const GURL& origin,
|
|
|
|
int render_process_id) override;
|
2016-04-27 02:52:26 +00:00
|
|
|
void DisplayNotification(content::BrowserContext* browser_context,
|
2015-03-09 02:37:13 +00:00
|
|
|
const GURL& origin,
|
|
|
|
const content::PlatformNotificationData& notification_data,
|
2016-04-27 02:52:26 +00:00
|
|
|
const content::NotificationResources& notification_resources,
|
2016-05-23 01:59:07 +00:00
|
|
|
std::unique_ptr<content::DesktopNotificationDelegate> delegate,
|
2015-03-09 02:37:13 +00:00
|
|
|
base::Closure* cancel_callback) override;
|
2015-04-21 10:54:57 +00:00
|
|
|
void DisplayPersistentNotification(
|
2015-03-09 02:37:13 +00:00
|
|
|
content::BrowserContext* browser_context,
|
2016-04-27 02:52:26 +00:00
|
|
|
int64_t persistent_notification_id,
|
2015-03-09 02:37:13 +00:00
|
|
|
const GURL& origin,
|
2016-04-27 02:52:26 +00:00
|
|
|
const content::PlatformNotificationData& notification_data,
|
|
|
|
const content::NotificationResources& notification_resources) override;
|
2015-04-21 10:54:57 +00:00
|
|
|
void ClosePersistentNotification(
|
2015-03-09 02:37:13 +00:00
|
|
|
content::BrowserContext* browser_context,
|
2015-07-23 06:53:42 +00:00
|
|
|
int64_t persistent_notification_id) override;
|
|
|
|
bool GetDisplayedPersistentNotifications(
|
|
|
|
content::BrowserContext* browser_context,
|
|
|
|
std::set<std::string>* displayed_notifications) override;
|
2015-03-09 02:37:13 +00:00
|
|
|
|
2015-12-24 14:20:47 +00:00
|
|
|
private:
|
|
|
|
BrowserClient* browser_client_;
|
2016-01-27 15:18:42 +00:00
|
|
|
int render_process_id_;
|
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
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace brightray
|
|
|
|
|
2015-12-24 14:20:47 +00:00
|
|
|
#endif // BROWSER_PLATFORM_NOTIFICATION_SERVICE_H_
|