Commit graph

64 commits

Author SHA1 Message Date
Ales Pergl
9b7fbd4d22 Address cpplint issue "Using C-style cast. Use reinterpret_cast<BYTE*>(...) instead [readability/casting] [4]" 2017-04-05 14:30:16 +02:00
Ales Pergl
91cff2e6c7 Address cpplint issue "Missing space before ( in if( [whitespace/parens] [5]" 2017-04-05 14:30:16 +02:00
Ales Pergl
29f3332276 Address cpplint issue "{ should almost always be at the end of the previous line [whitespace/braces] [4]" 2017-04-05 14:30:16 +02:00
Ales Pergl
63eeb96e71 Address cpplint issue "Do not use namespace using-directives. Use using-declarations instead. [build/namespaces] [5]" 2017-04-05 14:30:16 +02:00
Ales Pergl
20d0bda538 Address cpplint issue "Found C++ system header after other header. Should be: toast.h, c system, c++ system, other. [build/include_order] [4]" 2017-04-05 14:30:16 +02:00
Ales Pergl
33b4936a68 Address cpplint issue "Include the directory when naming .h files [build/include] [4]" 2017-04-05 14:30:15 +02:00
Ales Pergl
0bba5b9b41 Address cpplint issue "Lines should be <= 80 characters long [whitespace/line_length] [2]" 2017-04-05 14:30:15 +02:00
Ales Pergl
392d606848 Changed member variable naming style to snake case 2017-04-05 14:30:15 +02:00
Ales Pergl
0fa6c82b3f Use NotificationPresenterWin7 on Windows 7 2017-04-05 14:30:15 +02:00
Ales Pergl
fe05b66a6c Added desktop notifications implementation for Windows 7 (and earlier) 2017-04-05 14:30:15 +02:00
Ales Pergl
e6a30388da Make Notification factory function a member of NotificationPresenter so that we can create different types of notifications based on runtime conditions. 2017-04-05 14:30:15 +02:00
Kevin Sawicki
2ece711c2e Format line length to 80 instead of 100 2017-03-23 15:47:30 -07:00
Kevin Sawicki
be0c0e278a Remove cpplint errors 2017-03-23 12:48:27 -07:00
Cheng Zhao
a749a3dd2a Fix Debug building on Windows 2017-01-26 16:09:45 +09:00
Cheng Zhao
851ef398fb Adapt to changes of Chrome 51 API changes 2016-05-23 10:59:07 +09:00
Cheng Zhao
593fb8cdf0 Delay notification events to next tick
It is possible that the events get emitted when calling Show(), which
would then delete the class before Show() ends, results in using members
of a deleted class.

By delaying the events to next tick we can effectively avoid this.
2016-04-15 16:20:36 +09:00
Cheng Zhao
f4c27c6d29 Store weak ref to Notification in ToastEventHandler 2016-04-15 16:14:13 +09:00
Cheng Zhao
ddee77fae4 Do not use get_Setting to determine whether notification is enabled
On Windows 10 get_Setting always returns DISABLED when the program has a
AppUserModelID.
2016-04-15 16:01:21 +09:00
Marco Trevisan (Treviño)
59ed6ad413 Notification: pass tag to Show method 2016-04-13 06:12:46 +02:00
Felix Rieseberg
b68be5c583 🏁 Notify only when enabled
- Previously, we'd attempt to create a notification no matter what the
  user's configuration was. Microsoft advises against that, because it
  can create race conditions if notifications are disabled.
- This fixes the issue.

Closes https://github.com/atom/electron/issues/4681
2016-03-15 17:10:24 -07:00
Paul Betts
157f3abe64 Not quite sure how this ever worked 2016-03-07 22:02:42 -08:00
Paul Betts
da59c0f58b basictypes.h => macros.h 2016-03-07 21:40:41 -08:00
Felix Rieseberg
728f0f985b 🏁 🍎 Add Silent Notification Support
* Implements support for silent notifications on Windows and OS X
 * Exposes bool `silent` to Linux notification presenters
2016-01-21 09:24:42 -08:00
Cheng Zhao
82cef44623 win: Fire NotificationFailed when failed to show notification 2015-12-25 11:17:35 +08:00
Cheng Zhao
b091f27abf win: Adapt to new Notification style 2015-12-25 11:05:48 +08:00
Cheng Zhao
513b6ae0d6 Do not use icon url when showing notification 2015-12-24 20:03:54 +08:00
Cheng Zhao
087eeedab8 Use application name when app user model ID is not available 2015-11-24 15:11:43 +08:00
Cheng Zhao
c060539562 Only create NotificationPresenter when succeeded to initailize toast manager
This fix crash when we failed to initailize toast manager.
2015-11-24 14:40:58 +08:00
Cheng Zhao
aa8d164036 Use AppUserModelID as app id 2015-11-20 13:28:37 +08:00
Felix Rieseberg
571b595571 Fix Tag Typo
We should probably have tests for Windows notifications ;-)
2015-11-16 07:41:37 -08:00
Cheng Zhao
8ff0b050f8 There is no more NotificationError 2015-11-16 16:47:34 +08:00
Milan Burda
dedf3553e2 Call content::DesktopNotificationDelegate::NotificationError when toast notification fails on Windows 2015-11-13 15:42:35 +01:00
Felix Rieseberg
b4ac9547c4 Windows Toasts: Don't call WFI statically 2015-11-10 18:37:43 -08:00
Felix Rieseberg
2c84d70f8f Delay Load WinRT Libraries 2015-11-10 18:04:09 -08:00
Cheng Zhao
f9f8a289d9 Simplify the management of objects 2015-11-10 20:23:08 +08:00
Cheng Zhao
4f73de0930 Make the toast type really work 2015-11-10 20:07:12 +08:00
Cheng Zhao
6b9371c4cd Use smart pointer for everything 2015-11-10 19:50:38 +08:00
Cheng Zhao
1b9c9e40e3 Code cleanup with Chromium's coding style 2015-11-10 18:30:58 +08:00
Cheng Zhao
37a89ee0d9 Fix compilation error 2015-11-10 18:04:46 +08:00
Milan Burda
8f5463faab Simplify ToastEventHandler using WRL::RuntimeClass, which implements the IUnknown interface 2015-11-09 20:47:18 +01:00
Jason Poon
8dbeca8c7f Windows Toasts: Hide(), Runtime Check, Header Cleanup 2015-11-09 12:00:50 +01:00
Felix Rieseberg
86ea0759d8 Windows Toasts: Icons, Events, Cleanup, Documentation
- Enable documentations
- Add a small usage example to the header
- Final cleanups
2015-11-09 12:00:49 +01:00
Jason Poon
498bff9e5a Windows Toasts: Enable Basic Notifications
To test this puppy out, build and open up the Chromium Dev Tools.
Then, run `new Notification("Test title", {body: "Test body"});`
2015-11-09 12:00:21 +01:00
Cheng Zhao
81d31b1d49 Remove Windows's devtools implementation. 2014-07-09 10:37:54 +08:00
Adam Roben
8f367f6b35 More coding style fixes 2014-07-07 14:42:30 -04:00
Adam Roben
e86c409e6b Update DevToolsWindow to use views and aura
This is required to make it work in Chrome 35.
2014-07-07 14:27:23 -04:00
Adam Roben
307d936d75 Update to use CR_* Windows message macros
See https://codereview.chromium.org/146833020.
2014-06-27 13:40:33 -04:00
Cheng Zhao
1b274a1fd6 Add comments on the usage of attached devtools. 2014-06-10 12:44:30 +08:00
Cheng Zhao
9a70c9bb44 Enable undocked devtools. 2014-06-10 12:35:23 +08:00
Cheng Zhao
d70d24c360 Implement setting dock side. 2014-06-10 12:03:20 +08:00