Bug 1496706 - Windows 8 doesn't return valid IInspectable when clicking toast notification. r=aklotz

When clicking toast notification window, OnActivate is called.  When using
Windows 8, 2nd parameter (IInspectable) might be nullptr.

So when this parameter is nullptr, it should recognize as alertclickcallback
with mClickable=true.

Differential Revision: https://phabricator.services.mozilla.com/D8076

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Makoto Kato 2018-10-23 20:59:02 +00:00
parent b42fc1b48b
commit 4b9422e251

View File

@ -398,10 +398,12 @@ ToastNotificationHandler::OnActivate(IToastNotification *notification,
IInspectable *inspectable)
{
if (mAlertListener) {
ComPtr<IToastActivatedEventArgs> eventArgs;
HRESULT hr = inspectable->QueryInterface(__uuidof(IToastActivatedEventArgs),
(void**)&eventArgs);
nsAutoString argString;
if (inspectable) {
ComPtr<IToastActivatedEventArgs> eventArgs;
HRESULT hr = inspectable->QueryInterface(
__uuidof(IToastActivatedEventArgs),
(void**)&eventArgs);
if (SUCCEEDED(hr)) {
HSTRING arguments;
hr = eventArgs->get_Arguments(&arguments);
@ -413,6 +415,7 @@ ToastNotificationHandler::OnActivate(IToastNotification *notification,
}
}
}
}
if (argString.EqualsLiteral("settings")) {
mAlertListener->Observe(nullptr, "alertsettingscallback", mCookie.get());