refactor: move notifications from brightray to atom (#15209)

This commit is contained in:
Milan Burda 2018-10-17 20:01:11 +02:00 committed by Alexey Kuzmin
parent 4d085c4aae
commit a369a4172b
46 changed files with 423 additions and 363 deletions

View file

@ -0,0 +1,58 @@
// 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.
#ifndef ATOM_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_H_
#define ATOM_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_H_
#include <set>
#include <string>
#include "content/public/browser/browser_context.h"
#include "content/public/browser/platform_notification_service.h"
namespace atom {
class AtomBrowserClient;
class PlatformNotificationService
: public content::PlatformNotificationService {
public:
explicit PlatformNotificationService(AtomBrowserClient* browser_client);
~PlatformNotificationService() override;
protected:
// content::PlatformNotificationService:
void DisplayNotification(
content::RenderProcessHost* render_process_host,
content::BrowserContext* browser_context,
const std::string& notification_id,
const GURL& origin,
const content::PlatformNotificationData& notification_data,
const content::NotificationResources& notification_resources) override;
void DisplayPersistentNotification(
content::BrowserContext* browser_context,
const std::string& notification_id,
const GURL& service_worker_scope,
const GURL& origin,
const content::PlatformNotificationData& notification_data,
const content::NotificationResources& notification_resources) override;
void ClosePersistentNotification(content::BrowserContext* browser_context,
const std::string& notification_id) override;
void CloseNotification(content::BrowserContext* browser_context,
const std::string& notification_id) override;
void GetDisplayedNotifications(
content::BrowserContext* browser_context,
const DisplayedNotificationsCallback& callback) override;
int64_t ReadNextPersistentNotificationId(
content::BrowserContext* browser_context) override;
private:
AtomBrowserClient* browser_client_;
DISALLOW_COPY_AND_ASSIGN(PlatformNotificationService);
};
} // namespace atom
#endif // ATOM_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_H_