cr round 2

This commit is contained in:
milad 2019-07-25 13:11:11 -07:00
parent 2f4566b63c
commit 5083e449b0
4 changed files with 16 additions and 14 deletions

View file

@ -87,6 +87,10 @@ Item {
} }
onFeaturePermissionRequested: { onFeaturePermissionRequested: {
if (permissionPopupBackground.visible === true) {
console.log("Browser engine requested a new permission, but user is already being presented with a different permission request. Aborting request for new permission...");
return;
}
permissionPopupBackground.securityOrigin = securityOrigin; permissionPopupBackground.securityOrigin = securityOrigin;
permissionPopupBackground.feature = feature; permissionPopupBackground.feature = feature;

View file

@ -146,6 +146,11 @@ Item {
} }
onFeaturePermissionRequested: { onFeaturePermissionRequested: {
if (permissionPopupBackground.visible === true) {
console.log("Browser engine requested a new permission, but user is already being presented with a different permission request. Aborting request for new permission...");
return;
}
permissionPopupBackground.securityOrigin = securityOrigin; permissionPopupBackground.securityOrigin = securityOrigin;
permissionPopupBackground.feature = feature; permissionPopupBackground.feature = feature;

View file

@ -41,6 +41,10 @@ WebEngineView {
WebSpinner { } WebSpinner { }
onFeaturePermissionRequested: { onFeaturePermissionRequested: {
if (permissionPopupBackground.visible === true) {
console.log("Browser engine requested a new permission, but user is already being presented with a different permission request. Aborting request for new permission...");
return;
}
permissionPopupBackground.securityOrigin = securityOrigin; permissionPopupBackground.securityOrigin = securityOrigin;
permissionPopupBackground.feature = feature; permissionPopupBackground.feature = feature;

View file

@ -26,13 +26,10 @@ Rectangle {
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
Rectangle { Rectangle {
id: webAccessHeaderContainer
height: 75 height: 75
anchors.top: parent.top
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
HifiStyles.RalewayBold { HifiStyles.RalewayBold {
id: webAccessHeaderText
text: "REQUEST FOR DEVICE ACCESS" text: "REQUEST FOR DEVICE ACCESS"
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
@ -44,12 +41,10 @@ Rectangle {
} }
Rectangle { Rectangle {
id: webAccessInfoContainer
height: 35 height: 35
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
HifiStyles.RalewayLight { HifiStyles.RalewayLight {
id: webAccessInfoText
text: "This website is attempting to " + root.permissionLanguage[root.currentRequestedPermission] + "." text: "This website is attempting to " + root.permissionLanguage[root.currentRequestedPermission] + "."
anchors.centerIn: parent anchors.centerIn: parent
@ -60,39 +55,33 @@ Rectangle {
} }
Rectangle { Rectangle {
id: permissionsButtonsRow
height: 100 height: 100
Layout.preferredWidth: parent.width Layout.preferredWidth: parent.width
Layout.topMargin: 35 Layout.topMargin: 35
property int space: 8 property int space: 8
readonly property int _LEFT_BUTTON: 0
readonly property int _RIGHT_BUTTON: 1
HifiControls.Button { HifiControls.Button {
id: leftButton
text: "Don't Allow" text: "Don't Allow"
anchors.right: parent.horizontalCenter anchors.right: parent.horizontalCenter
anchors.rightMargin: parent.space anchors.rightMargin: parent.space
width: 125
color: hifi.buttons.red color: hifi.buttons.red
enabled: true
height: 38 height: 38
onClicked: { onClicked: {
root.permissionButtonPressed(parent._LEFT_BUTTON); root.permissionButtonPressed(0);
} }
} }
HifiControls.Button { HifiControls.Button {
id: rightButton
text: "Yes allow access" text: "Yes allow access"
anchors.left: parent.horizontalCenter anchors.left: parent.horizontalCenter
anchors.leftMargin: parent.space anchors.leftMargin: parent.space
color: hifi.buttons.blue color: hifi.buttons.blue
enabled: true
width: 155 width: 155
height: 38 height: 38
onClicked: { onClicked: {
root.permissionButtonPressed(parent._RIGHT_BUTTON); root.permissionButtonPressed(1);
} }
} }
} }