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