2015-11-04 11:13:52 -07:00
|
|
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
2017-03-23 13:48:22 -06:00
|
|
|
// Copyright (c) 2015 Felix Rieseberg <feriese@microsoft.com> and
|
|
|
|
// Jason Poon <jason.poon@microsoft.com>. All rights reserved.
|
2015-11-04 11:13:52 -07:00
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE-CHROMIUM file.
|
|
|
|
|
2015-11-07 20:41:29 -07:00
|
|
|
// Usage Example (JavaScript:
|
|
|
|
// var windowsNotification = new Notification("Test Title", {
|
2017-03-23 13:48:22 -06:00
|
|
|
// body: "Hi, I'm an example body. How are you?",
|
|
|
|
// icon: "file:///C:/Path/To/Your/Image.png"
|
2015-11-07 20:41:29 -07:00
|
|
|
// });
|
|
|
|
|
2017-03-23 16:47:30 -06:00
|
|
|
// windowsNotification.onshow = function () {
|
|
|
|
// console.log("Notification shown")
|
|
|
|
// };
|
|
|
|
// windowsNotification.onclick = function () {
|
|
|
|
// console.log("Notification clicked")
|
|
|
|
// };
|
|
|
|
// windowsNotification.onclose = function () {
|
|
|
|
// console.log("Notification dismissed")
|
|
|
|
// };
|
2015-11-07 20:41:29 -07:00
|
|
|
|
2021-11-22 00:34:31 -07:00
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_NOTIFICATION_PRESENTER_WIN_H_
|
|
|
|
#define ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_NOTIFICATION_PRESENTER_WIN_H_
|
2015-11-04 11:13:52 -07:00
|
|
|
|
2015-12-24 05:03:54 -07:00
|
|
|
#include "base/files/scoped_temp_dir.h"
|
2019-06-19 14:46:59 -06:00
|
|
|
#include "shell/browser/notifications/notification_presenter.h"
|
2015-11-10 05:07:12 -07:00
|
|
|
|
2015-12-24 05:03:54 -07:00
|
|
|
class GURL;
|
2015-12-24 20:05:48 -07:00
|
|
|
class SkBitmap;
|
2015-12-24 05:03:54 -07:00
|
|
|
|
2019-06-19 15:23:04 -06:00
|
|
|
namespace electron {
|
2015-11-04 11:13:52 -07:00
|
|
|
|
|
|
|
class NotificationPresenterWin : public NotificationPresenter {
|
|
|
|
public:
|
|
|
|
NotificationPresenterWin();
|
2018-06-21 17:45:45 -06:00
|
|
|
~NotificationPresenterWin() override;
|
2015-11-04 11:13:52 -07:00
|
|
|
|
2015-12-24 05:03:54 -07:00
|
|
|
bool Init();
|
|
|
|
|
2021-03-18 13:55:51 -06:00
|
|
|
std::wstring SaveIconToFilesystem(const SkBitmap& icon, const GURL& origin);
|
2015-11-10 03:27:18 -07:00
|
|
|
|
2015-11-04 11:13:52 -07:00
|
|
|
private:
|
2024-06-20 02:49:07 -06:00
|
|
|
// NotificationPresenter
|
2017-04-03 02:38:21 -06:00
|
|
|
Notification* CreateNotificationObject(
|
|
|
|
NotificationDelegate* delegate) override;
|
2017-01-10 08:34:41 -07:00
|
|
|
|
2015-12-24 05:03:54 -07:00
|
|
|
base::ScopedTempDir temp_dir_;
|
2015-11-04 11:13:52 -07:00
|
|
|
};
|
|
|
|
|
2019-06-19 15:23:04 -06:00
|
|
|
} // namespace electron
|
2015-11-04 11:13:52 -07:00
|
|
|
|
2021-11-22 00:34:31 -07:00
|
|
|
#endif // ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_NOTIFICATION_PRESENTER_WIN_H_
|