notification_presenter_win.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. // Copyright (c) 2015 Felix Rieseberg <feriese@microsoft.com> and
  3. // Jason Poon <jason.poon@microsoft.com>. All rights reserved.
  4. // Use of this source code is governed by a BSD-style license that can be
  5. // found in the LICENSE-CHROMIUM file.
  6. // Usage Example (JavaScript:
  7. // var windowsNotification = new Notification("Test Title", {
  8. // body: "Hi, I'm an example body. How are you?",
  9. // icon: "file:///C:/Path/To/Your/Image.png"
  10. // });
  11. // windowsNotification.onshow = function () {
  12. // console.log("Notification shown")
  13. // };
  14. // windowsNotification.onclick = function () {
  15. // console.log("Notification clicked")
  16. // };
  17. // windowsNotification.onclose = function () {
  18. // console.log("Notification dismissed")
  19. // };
  20. #ifndef BRIGHTRAY_BROWSER_WIN_NOTIFICATION_PRESENTER_WIN_H_
  21. #define BRIGHTRAY_BROWSER_WIN_NOTIFICATION_PRESENTER_WIN_H_
  22. #include "base/files/scoped_temp_dir.h"
  23. #include "base/strings/string16.h"
  24. #include "brightray/browser/notification_presenter.h"
  25. class GURL;
  26. class SkBitmap;
  27. namespace brightray {
  28. class NotificationPresenterWin : public NotificationPresenter {
  29. public:
  30. NotificationPresenterWin();
  31. ~NotificationPresenterWin();
  32. bool Init();
  33. base::string16 SaveIconToFilesystem(const SkBitmap& icon, const GURL& origin);
  34. private:
  35. Notification* CreateNotificationObject(
  36. NotificationDelegate* delegate) override;
  37. base::ScopedTempDir temp_dir_;
  38. DISALLOW_COPY_AND_ASSIGN(NotificationPresenterWin);
  39. };
  40. } // namespace brightray
  41. #endif // BRIGHTRAY_BROWSER_WIN_NOTIFICATION_PRESENTER_WIN_H_