diff --git a/dom/base/nsContentPermissionHelper.cpp b/dom/base/nsContentPermissionHelper.cpp index f33ecf283f8e..c6038a48d889 100644 --- a/dom/base/nsContentPermissionHelper.cpp +++ b/dom/base/nsContentPermissionHelper.cpp @@ -17,6 +17,7 @@ #include "mozilla/dom/PermissionMessageUtils.h" #include "mozilla/dom/PContentPermissionRequestParent.h" #include "mozilla/dom/ScriptSettings.h" +#include "mozilla/dom/UserActivation.h" #include "mozilla/Attributes.h" #include "mozilla/Preferences.h" #include "mozilla/Unused.h" @@ -539,7 +540,7 @@ ContentPermissionRequestBase::ContentPermissionRequestBase( mRequester(aWindow ? new nsContentPermissionRequester(aWindow) : nullptr), mPrefName(aPrefName), mType(aType), - mIsHandlingUserInput(false), + mIsHandlingUserInput(UserActivation::IsHandlingUserInput()), mMaybeUnsafePermissionDelegate(false) { if (!aWindow) { return; @@ -550,8 +551,6 @@ ContentPermissionRequestBase::ContentPermissionRequestBase( return; } - mIsHandlingUserInput = doc->HasValidTransientUserGestureActivation(); - mPermissionHandler = doc->GetPermissionDelegateHandler(); if (mPermissionHandler) { nsTArray types; diff --git a/dom/push/Push.jsm b/dom/push/Push.jsm index 5fb1ced9404c..57dfca964f21 100644 --- a/dom/push/Push.jsm +++ b/dom/push/Push.jsm @@ -70,8 +70,7 @@ Push.prototype = { askPermission() { console.debug("askPermission()"); - let isHandlingUserInput = this._window.document - .hasValidTransientUserGestureActivation; + let isHandlingUserInput = this._window.windowUtils.isHandlingUserInput; return this.createPromise((resolve, reject) => { let permissionDenied = () => {