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.
|
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_H_
|
2015-03-09 02:37:13 +00:00
|
|
|
|
2017-05-18 22:06:57 +00:00
|
|
|
#include <string>
|
|
|
|
|
2023-05-11 20:07:39 +00:00
|
|
|
#include "base/memory/raw_ptr.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 electron {
|
2015-03-09 02:37:13 +00:00
|
|
|
|
2018-10-17 18:01:11 +00:00
|
|
|
class ElectronBrowserClient;
|
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(ElectronBrowserClient* browser_client);
|
2015-12-24 14:20:47 +00:00
|
|
|
~PlatformNotificationService() override;
|
2015-03-09 02:37:13 +00:00
|
|
|
|
2021-11-03 11:41:45 +00:00
|
|
|
// disable copy
|
|
|
|
PlatformNotificationService(const PlatformNotificationService&) = delete;
|
|
|
|
PlatformNotificationService& operator=(const PlatformNotificationService&) =
|
|
|
|
delete;
|
|
|
|
|
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(
|
2021-04-29 18:23:28 +00:00
|
|
|
content::RenderFrameHost* render_frame_host,
|
2017-01-23 08:48:16 +00:00
|
|
|
const std::string& notification_id,
|
2015-03-09 02:37:13 +00:00
|
|
|
const GURL& origin,
|
2021-04-27 21:27:34 +00:00
|
|
|
const GURL& document_url,
|
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(
|
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,
|
refactor: put empty virtual function definitions in header (#43285)
* refactor: in FramelessView, move empty function decls to header
* refactor: in electron::api::WebContents, move empty function decls to header
* refactor: in electron::api::NativeWindow, move empty function decls to header
* refactor: in electron::OffScreenWebContentsView, move empty function decls to header
* refactor: in electron::OffScreenRenderWidgetHostView, move empty function decls to header
* refactor: in auto_updater::AutoUpdater, move empty function decls to header
* refactor: in electorn::api::FrameSubscriber, move empty function decls to header
* refactor: in electorn::api::SimpleURLLoaderWrapper, move empty function decls to header
* refactor: in electorn::InspectableWebContents, move empty function decls to header
* refactor: in electorn::OffScreenVideoConsumer, move empty function decls to header
* refactor: in electron::OffScreenWebContentsView, move empty function decls to header
* refactor: in electron::TrayIcon, move empty function decls to header
* refactor: in electron::ViewsDelegate, move empty function decls to header
* refactor: in electron::MediaCaptureDevicesDispatcher, move empty function decls to header
* refactor: in electron::UsbChooserContext::DeviceObserver, move empty function decls to header
* refactor: in electron::ProxyingWebSocket, move empty function decls to header
* refactor: in electron::Notification, move empty function decls to header
* refactor: in electron::PlatformNotificationService, move empty function decls to header
* Revert "refactor: in electron::PlatformNotificationService, move empty function decls to header"
This reverts commit 9103750d03b9ba1ceccba43d11dfdc2404ff6191.
* refactor: in electron::ElectronPDFDocumentHelperClient, move empty function decls to header
* refactor: in electron::api::SpellCheckClient, move empty function decls to header
* refactor: in electron::ElectronExtensionHostDelegate, move empty function decls to header
* refactor: in electron::PlatformNotificationService, move empty function decls to header
* refactor: in electron::NativeWindowViews, move empty function decls to header
* chore: move SetTouchBar() back to cc
* Revert "refactor: in auto_updater::AutoUpdater, move empty function decls to header"
This reverts commit c43d6862d32c74f63f82700a7546a732ac05ecb8.
2024-08-12 07:56:51 +00:00
|
|
|
const blink::NotificationResources& notification_resources) override {}
|
|
|
|
void ClosePersistentNotification(
|
|
|
|
const std::string& notification_id) override {}
|
2019-04-20 17:20:37 +00:00
|
|
|
void CloseNotification(const std::string& notification_id) override;
|
2017-06-16 21:48:59 +00:00
|
|
|
void GetDisplayedNotifications(
|
2019-02-21 07:50:18 +00:00
|
|
|
DisplayedNotificationsCallback callback) override;
|
2023-10-02 22:01:07 +00:00
|
|
|
void GetDisplayedNotificationsForOrigin(
|
|
|
|
const GURL& origin,
|
|
|
|
DisplayedNotificationsCallback callback) override;
|
2019-04-20 17:20:37 +00:00
|
|
|
int64_t ReadNextPersistentNotificationId() override;
|
2018-10-25 17:19:44 +00:00
|
|
|
void RecordNotificationUkmEvent(
|
|
|
|
const content::NotificationDatabaseData& data) override;
|
2019-04-20 17:20:37 +00:00
|
|
|
void ScheduleTrigger(base::Time timestamp) override;
|
|
|
|
base::Time ReadNextTriggerTimestamp() override;
|
2015-03-09 02:37:13 +00:00
|
|
|
|
2015-12-24 14:20:47 +00:00
|
|
|
private:
|
2023-05-11 20:07:39 +00:00
|
|
|
raw_ptr<ElectronBrowserClient> browser_client_;
|
2015-03-09 02:37:13 +00:00
|
|
|
};
|
|
|
|
|
2018-10-17 18:01:11 +00:00
|
|
|
} // namespace electron
|
2015-03-09 02:37:13 +00:00
|
|
|
|
2021-11-22 07:34:31 +00:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_NOTIFICATIONS_PLATFORM_NOTIFICATION_SERVICE_H_
|