Bug 1224137 - List the 'allow pages from <example.com> to take you to their tab' permission (for alerts/prompts) in the site identity / permission panel. r=johannh

MozReview-Commit-ID: LGDNUbpVEgX

--HG--
extra : rebase_source : f18d8c15ecb2aab0554d2ce8a9c59619a84b2890
This commit is contained in:
Prathiksha 2017-03-23 12:30:57 +05:30
Родитель 33297fc924
Коммит e9f21d2948
5 изменённых файлов: 29 добавлений и 2 удалений

Просмотреть файл

@ -50,6 +50,20 @@ add_task(function*() {
is(ps.ALLOW_ACTION, ps.testPermission(makeURI(pageWithAlert), "focus-tab-by-prompt"), is(ps.ALLOW_ACTION, ps.testPermission(makeURI(pageWithAlert), "focus-tab-by-prompt"),
"Tab switching should now be allowed"); "Tab switching should now be allowed");
// Check if the control center shows the correct permission.
let shown = BrowserTestUtils.waitForEvent(gIdentityHandler._identityPopup, "popupshown");
gIdentityHandler._identityBox.click();
yield shown;
let labelText = SitePermissions.getPermissionLabel("focus-tab-by-prompt");
let permissionsList = document.getElementById("identity-popup-permission-list");
let label = permissionsList.querySelector(".identity-popup-permission-label");
is(label.textContent, labelText);
gIdentityHandler._identityPopup.hidePopup()
// Check if the identity icon signals granted permission.
ok(gIdentityHandler._identityBox.classList.contains("grantedPermissions"),
"identity-box signals granted permissions");
let openedTabSelectedPromise = BrowserTestUtils.waitForAttribute("selected", openedTab, "true"); let openedTabSelectedPromise = BrowserTestUtils.waitForAttribute("selected", openedTab, "true");
// switch to other tab again // switch to other tab again
yield BrowserTestUtils.switchTab(gBrowser, firstTab); yield BrowserTestUtils.switchTab(gBrowser, firstTab);
@ -63,3 +77,4 @@ add_task(function*() {
yield BrowserTestUtils.removeTab(openedTab); yield BrowserTestUtils.removeTab(openedTab);
}); });

Просмотреть файл

@ -35,3 +35,4 @@ permission.install.label = Install Add-ons
permission.popup.label = Open Pop-up Windows permission.popup.label = Open Pop-up Windows
permission.geo.label = Access Your Location permission.geo.label = Access Your Location
permission.indexedDB.label = Maintain Offline Storage permission.indexedDB.label = Maintain Offline Storage
permission.focus-tab-by-prompt.label = Switch to this Tab

Просмотреть файл

@ -608,9 +608,14 @@ var gPermissionObject = {
exactHostMatch: true exactHostMatch: true
}, },
"indexedDB": {} "indexedDB": {},
"focus-tab-by-prompt": {
exactHostMatch: true,
states: [ SitePermissions.UNKNOWN, SitePermissions.ALLOW ],
},
}; };
XPCOMUtils.defineLazyPreferenceGetter(SitePermissions, "temporaryPermissionExpireTime", XPCOMUtils.defineLazyPreferenceGetter(SitePermissions, "temporaryPermissionExpireTime",
"privacy.temporary_permission_expire_time_ms", 3600 * 1000); "privacy.temporary_permission_expire_time_ms", 3600 * 1000);

Просмотреть файл

@ -33,6 +33,10 @@
/* INDIVIDUAL NOTIFICATIONS */ /* INDIVIDUAL NOTIFICATIONS */
.focus-tab-by-prompt-icon {
list-style-image: url(chrome://browser/skin/notification-icons.svg#focus-tab-by-prompt);
}
.popup-notification-icon[popupid="web-notifications"], .popup-notification-icon[popupid="web-notifications"],
.desktop-notification-icon { .desktop-notification-icon {
list-style-image: url(chrome://browser/skin/notification-icons.svg#desktop-notification); list-style-image: url(chrome://browser/skin/notification-icons.svg#desktop-notification);

Просмотреть файл

@ -49,6 +49,7 @@
<defs> <defs>
<path id="camera-icon" d="m 2,23 a 3,3 0 0 0 3,3 l 14,0 a 3,3 0 0 0 3,-3 l 0,-4 6,5.5 c 0.5,0.5 1,0.7 2,0.5 l 0,-18 c -1,-0.2 -1.5,0 -2,0.5 l -6,5.5 0,-4 a 3,3 0 0 0 -3,-3 l -14,0 a 3,3 0 0 0 -3,3 z" /> <path id="camera-icon" d="m 2,23 a 3,3 0 0 0 3,3 l 14,0 a 3,3 0 0 0 3,-3 l 0,-4 6,5.5 c 0.5,0.5 1,0.7 2,0.5 l 0,-18 c -1,-0.2 -1.5,0 -2,0.5 l -6,5.5 0,-4 a 3,3 0 0 0 -3,-3 l -14,0 a 3,3 0 0 0 -3,3 z" />
<path id="desktop-notification-icon" d="m 2,20 a 4,4 0 0 0 4,4 l 13,0 7,7 0,-7 a 4,4 0 0 0 4,-4 l 0,-12 a 4,4 0 0 0 -4,-4 l -20,0 a 4,4 0 0 0 -4,4 z m 5,-2 a 1,1 0 1 1 0,-2 l 10,0 a 1,1 0 1 1 0,2 z m 0,-4 a 1,1 0 1 1 0,-2 l 14,0 a 1,1 0 1 1 0,2 z m 0,-4 a 1,1 0 1 1 0,-2 l 18,0 a 1,1 0 1 1 0,2 z" /> <path id="desktop-notification-icon" d="m 2,20 a 4,4 0 0 0 4,4 l 13,0 7,7 0,-7 a 4,4 0 0 0 4,-4 l 0,-12 a 4,4 0 0 0 -4,-4 l -20,0 a 4,4 0 0 0 -4,4 z m 5,-2 a 1,1 0 1 1 0,-2 l 10,0 a 1,1 0 1 1 0,2 z m 0,-4 a 1,1 0 1 1 0,-2 l 14,0 a 1,1 0 1 1 0,2 z m 0,-4 a 1,1 0 1 1 0,-2 l 18,0 a 1,1 0 1 1 0,2 z" />
<path id="focus-tab-by-prompt-icon" d="M29.43,25,18.57,3.8A2.92,2.92,0,0,0,16,2a2.92,2.92,0,0,0-2.57,1.8L2.57,25a3.47,3.47,0,0,0,0,3.4A3.15,3.15,0,0,0,5.33,30H26.66a3.15,3.15,0,0,0,2.77-1.6A3.47,3.47,0,0,0,29.43,25ZM16,7.2a2.3,2.3,0,0,1,2.37,2.4L18,18a1.88,1.88,0,0,1-2,2,1.88,1.88,0,0,1-2-2l-.4-8.4A2.3,2.3,0,0,1,16,7.2ZM16,28a3,3,0,0,1,0-6,3,3,0,0,1,0,6Z"/>
<path id="geo-linux-icon" d="m 2,15.9 a 14,14 0 1 1 0,0.2 z m 4,2.1 a 10,10 0 0 0 8,8 l 0,-4 4,0 0,4 a 10,10 0 0 0 8,-8 l -4,0 0,-4 4,0 a 10,10 0 0 0 -8,-8 l 0,4 -4,0 0,-4 a 10,10 0 0 0 -8,8 l 4,0 0,4 z" /> <path id="geo-linux-icon" d="m 2,15.9 a 14,14 0 1 1 0,0.2 z m 4,2.1 a 10,10 0 0 0 8,8 l 0,-4 4,0 0,4 a 10,10 0 0 0 8,-8 l -4,0 0,-4 4,0 a 10,10 0 0 0 -8,-8 l 0,4 -4,0 0,-4 a 10,10 0 0 0 -8,8 l 4,0 0,4 z" />
<path id="geo-linux-detailed-icon" d="m 2,15.9 a 14,14 0 1 1 0,0.2 z m 3,2.1 a 11,11 0 0 0 9,9 l 1,-5 2,0 1,5 a 11,11 0 0 0 9,-9 l -5,-1 0,-2 5,-1 a 11,11 0 0 0 -9,-9 l -1,5 -2,0 -1,-5 a 11,11 0 0 0 -9,9 l 5,1 0,2 z" /> <path id="geo-linux-detailed-icon" d="m 2,15.9 a 14,14 0 1 1 0,0.2 z m 3,2.1 a 11,11 0 0 0 9,9 l 1,-5 2,0 1,5 a 11,11 0 0 0 9,-9 l -5,-1 0,-2 5,-1 a 11,11 0 0 0 -9,-9 l -1,5 -2,0 -1,-5 a 11,11 0 0 0 -9,9 l 5,1 0,2 z" />
<path id="geo-osx-icon" d="m 0,16 16,0 0,16 12,-28 z" /> <path id="geo-osx-icon" d="m 0,16 16,0 0,16 12,-28 z" />
@ -84,6 +85,7 @@
<use id="camera-blocked" class="blocked" xlink:href="#camera-icon" /> <use id="camera-blocked" class="blocked" xlink:href="#camera-icon" />
<use id="desktop-notification" xlink:href="#desktop-notification-icon" /> <use id="desktop-notification" xlink:href="#desktop-notification-icon" />
<use id="desktop-notification-blocked" class="blocked" xlink:href="#desktop-notification-icon" /> <use id="desktop-notification-blocked" class="blocked" xlink:href="#desktop-notification-icon" />
<use id="focus-tab-by-prompt" xlink:href="#focus-tab-by-prompt-icon" />
<use id="geo-osx" xlink:href="#geo-osx-icon" /> <use id="geo-osx" xlink:href="#geo-osx-icon" />
<use id="geo-osx-blocked" class="blocked" xlink:href="#geo-osx-icon" /> <use id="geo-osx-blocked" class="blocked" xlink:href="#geo-osx-icon" />
<use id="geo-linux" xlink:href="#geo-linux-icon" /> <use id="geo-linux" xlink:href="#geo-linux-icon" />

До

Ширина:  |  Высота:  |  Размер: 7.1 KiB

После

Ширина:  |  Высота:  |  Размер: 7.5 KiB