mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
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:
parent
b42fc1b48b
commit
4b9422e251
@ -398,18 +398,21 @@ ToastNotificationHandler::OnActivate(IToastNotification *notification,
|
||||
IInspectable *inspectable)
|
||||
{
|
||||
if (mAlertListener) {
|
||||
ComPtr<IToastActivatedEventArgs> eventArgs;
|
||||
HRESULT hr = inspectable->QueryInterface(__uuidof(IToastActivatedEventArgs),
|
||||
(void**)&eventArgs);
|
||||
nsAutoString argString;
|
||||
if (SUCCEEDED(hr)) {
|
||||
HSTRING arguments;
|
||||
hr = eventArgs->get_Arguments(&arguments);
|
||||
if (inspectable) {
|
||||
ComPtr<IToastActivatedEventArgs> eventArgs;
|
||||
HRESULT hr = inspectable->QueryInterface(
|
||||
__uuidof(IToastActivatedEventArgs),
|
||||
(void**)&eventArgs);
|
||||
if (SUCCEEDED(hr)) {
|
||||
uint32_t len = 0;
|
||||
const wchar_t* buffer = WindowsGetStringRawBuffer(arguments, &len);
|
||||
if (buffer) {
|
||||
argString.Assign(buffer, len);
|
||||
HSTRING arguments;
|
||||
hr = eventArgs->get_Arguments(&arguments);
|
||||
if (SUCCEEDED(hr)) {
|
||||
uint32_t len = 0;
|
||||
const wchar_t* buffer = WindowsGetStringRawBuffer(arguments, &len);
|
||||
if (buffer) {
|
||||
argString.Assign(buffer, len);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user