Closed Bug 973489 Opened 6 years ago Closed 6 years ago

Allow ToastNotification on desktop mode

Categories

(Core :: Widget: Win32, defect)

x86
Windows 8.1
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: m_kato, Assigned: m_kato)

Details

Attachments

(2 files, 1 obsolete file)

Actually, nsIWinMetroUtils.showNativeToast only supports Metro mode.
We should support it on desktop too for addon developer.
Even if closing toast notification, ToastNotificationHandler isn't deleted.
Attachment #8376964 - Attachment is obsolete: true
Comment on attachment 8376979 [details] [diff] [review]
Part 1. Support toast notification on desktop mode

allow showNativeToast for desktop.  Also it moves foreground check to another method because this check is unnecessary on desktop mode.
Attachment #8376979 - Flags: review?(jmathies)
Comment on attachment 8376965 [details] [diff] [review]
Part 2. Fix memory leak

Current ToastNotificationHandler implementation will leak memory.  When dismiss, object should be destroyed.
Attachment #8376965 - Flags: review?(jmathies)
Interesting, these winrt runtime apis are working in desktop?
Attachment #8376965 - Flags: review?(jmathies) → review+
Comment on attachment 8376979 [details] [diff] [review]
Part 1. Support toast notification on desktop mode

Review of attachment 8376979 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/metro/base/content/helperui/AlertsHelper.js
@@ +12,5 @@
>        Services.obs.addObserver(this, "metro_native_toast_shown", false);
>      }
>      this._listener = aListener;
>  
> +    if (Services.metro.foreground) {

nice.

::: widget/nsIWinMetroUtils.idl
@@ +40,5 @@
>     */
>    attribute boolean updatePending;
>  
> +  /*
> +   * Determine if the firefox is in the foreground

Since we're now mixing use maybe be more explicit - "Determine if metro firefox is running in the foreground."
Attachment #8376979 - Flags: review?(jmathies) → review+
(In reply to Jim Mathies [:jimm] from comment #6)
> Interesting, these winrt runtime apis are working in desktop?

Yes.  ToastNotification works on desktop.  Some WinRT APIs also work on Desktop.
You need to log in before you can comment on or make changes to this bug.