diff --git a/browser/base/content/browser-sync.js b/browser/base/content/browser-sync.js index b31ec2c1d7d3..c814284b2573 100644 --- a/browser/base/content/browser-sync.js +++ b/browser/base/content/browser-sync.js @@ -384,8 +384,7 @@ var gSync = { const clients = this.remoteClients; for (let client of clients) { - const type = client.formfactor && client.formfactor.includes("tablet") ? - "tablet" : client.type; + const type = Weave.Service.clientsEngine.getClientType(client.id); addTargetDevice(client.id, client.name, type, new Date(client.serverLastModified * 1000)); } diff --git a/browser/components/syncedtabs/TabListView.js b/browser/components/syncedtabs/TabListView.js index 431bda7dd709..1ce9de8a72d4 100644 --- a/browser/components/syncedtabs/TabListView.js +++ b/browser/components/syncedtabs/TabListView.js @@ -231,14 +231,10 @@ TabListView.prototype = { } else { itemNode.classList.remove("selected"); } - if (item.isMobile) { - itemNode.classList.add("device-image-mobile"); - } else { - itemNode.classList.add("device-image-desktop"); - } if (item.focused) { itemNode.focus(); } + itemNode.setAttribute("clientType", item.clientType); itemNode.dataset.id = item.id; itemNode.querySelector(".item-title").textContent = item.name; }, diff --git a/browser/components/syncedtabs/test/browser/browser_sidebar_syncedtabslist.js b/browser/components/syncedtabs/test/browser/browser_sidebar_syncedtabslist.js index a24522d6a2c4..88c830f01bf9 100644 --- a/browser/components/syncedtabs/test/browser/browser_sidebar_syncedtabslist.js +++ b/browser/components/syncedtabs/test/browser/browser_sidebar_syncedtabslist.js @@ -6,7 +6,7 @@ const FIXTURE = [ "type": "client", "lastModified": 1492201200, "name": "zcarter's Nightly on MacBook-Pro-25", - "isMobile": false, + "clientType": "desktop", "tabs": [ { "type": "tab", @@ -23,7 +23,7 @@ const FIXTURE = [ "type": "client", "lastModified": 1492201200, "name": "laptop", - "isMobile": false, + "clientType": "desktop", "tabs": [ { "type": "tab", @@ -57,7 +57,7 @@ const FIXTURE = [ "type": "client", "lastModified": 1492201200, "name": "desktop", - "isMobile": false, + "clientType": "desktop", "tabs": [] } ]; diff --git a/browser/themes/linux/jar.mn b/browser/themes/linux/jar.mn index 193889a0f51a..268ed815cdc8 100644 --- a/browser/themes/linux/jar.mn +++ b/browser/themes/linux/jar.mn @@ -49,8 +49,6 @@ browser.jar: skin/classic/browser/preferences/applications.css (preferences/applications.css) skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) - skin/classic/browser/sync-desktopIcon.svg (../shared/sync-desktopIcon.svg) - skin/classic/browser/sync-mobileIcon.svg (../shared/sync-mobileIcon.svg) skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png) [extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar: diff --git a/browser/themes/osx/jar.mn b/browser/themes/osx/jar.mn index 0331e3ffd682..c885866557c0 100644 --- a/browser/themes/osx/jar.mn +++ b/browser/themes/osx/jar.mn @@ -58,8 +58,6 @@ browser.jar: skin/classic/browser/preferences/applications.css (preferences/applications.css) skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) skin/classic/browser/tabbrowser/tabDragIndicator@2x.png (tabbrowser/tabDragIndicator@2x.png) - skin/classic/browser/sync-desktopIcon.svg (../shared/sync-desktopIcon.svg) - skin/classic/browser/sync-mobileIcon.svg (../shared/sync-mobileIcon.svg) skin/classic/browser/e10s-64@2x.png (../shared/e10s-64@2x.png) [extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar: diff --git a/browser/themes/shared/icons/device-mobile.svg b/browser/themes/shared/icons/device-phone.svg similarity index 100% rename from browser/themes/shared/icons/device-mobile.svg rename to browser/themes/shared/icons/device-phone.svg diff --git a/browser/themes/shared/jar.inc.mn b/browser/themes/shared/jar.inc.mn index d5e552ade07c..c729beccfbae 100644 --- a/browser/themes/shared/jar.inc.mn +++ b/browser/themes/shared/jar.inc.mn @@ -128,7 +128,7 @@ skin/classic/browser/check-animation.svg (../shared/icons/check-animation.svg) skin/classic/browser/customize.svg (../shared/icons/customize.svg) skin/classic/browser/developer.svg (../shared/icons/developer.svg) - skin/classic/browser/device-mobile.svg (../shared/icons/device-mobile.svg) + skin/classic/browser/device-phone.svg (../shared/icons/device-phone.svg) skin/classic/browser/device-tablet.svg (../shared/icons/device-tablet.svg) skin/classic/browser/device-desktop.svg (../shared/icons/device-desktop.svg) skin/classic/browser/edit-copy.svg (../shared/icons/edit-copy.svg) diff --git a/browser/themes/shared/menupanel.inc.css b/browser/themes/shared/menupanel.inc.css index 0d4d8cb66d60..137afca12f33 100644 --- a/browser/themes/shared/menupanel.inc.css +++ b/browser/themes/shared/menupanel.inc.css @@ -83,7 +83,7 @@ } #PanelUI-remotetabs-view-managedevices { - list-style-image: url("chrome://browser/skin/device-mobile.svg"); + list-style-image: url("chrome://browser/skin/device-phone.svg"); } #appMenuViewHistorySidebar, diff --git a/browser/themes/shared/sync-desktopIcon.svg b/browser/themes/shared/sync-desktopIcon.svg deleted file mode 100644 index 2002e9bf04c5..000000000000 --- a/browser/themes/shared/sync-desktopIcon.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/browser/themes/shared/sync-mobileIcon.svg b/browser/themes/shared/sync-mobileIcon.svg deleted file mode 100644 index 5325793bdceb..000000000000 --- a/browser/themes/shared/sync-mobileIcon.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/browser/themes/shared/syncedtabs/sidebar.inc.css b/browser/themes/shared/syncedtabs/sidebar.inc.css index 8b6c52b576e5..bbff1efad359 100644 --- a/browser/themes/shared/syncedtabs/sidebar.inc.css +++ b/browser/themes/shared/syncedtabs/sidebar.inc.css @@ -88,24 +88,25 @@ body { padding-inline-start: 20px; } -.item.client.device-image-desktop > .item-title-container > .item-icon-container { - background-image: url("chrome://browser/skin/sync-desktopIcon.svg"); +.item.client[clientType] > .item-title-container > .item-icon-container { -moz-context-properties: fill; fill: #4d4d4d; } -.item.client.device-image-desktop.selected:focus > .item-title-container > .item-icon-container { +.item.client[clientType].selected:focus > .item-title-container > .item-icon-container { fill: white; } -.item.client.device-image-mobile > .item-title-container > .item-icon-container { - background-image: url("chrome://browser/skin/sync-mobileIcon.svg"); - -moz-context-properties: fill; - fill: #4d4d4d; +.item.client[clientType=phone] > .item-title-container > .item-icon-container { + background-image: url("chrome://browser/skin/device-phone.svg"); } -.item.client.device-image-mobile.selected:focus > .item-title-container > .item-icon-container { - fill: white; +.item.client[clientType=tablet] > .item-title-container > .item-icon-container { + background-image: url("chrome://browser/skin/device-tablet.svg"); +} + +.item.client[clientType=desktop] > .item-title-container > .item-icon-container { + background-image: url("chrome://browser/skin/device-desktop.svg"); } .item.tab > .item-title-container > .item-icon-container { diff --git a/browser/themes/shared/urlbar-searchbar.inc.css b/browser/themes/shared/urlbar-searchbar.inc.css index 55afce6aaa97..3ec165955d4b 100644 --- a/browser/themes/shared/urlbar-searchbar.inc.css +++ b/browser/themes/shared/urlbar-searchbar.inc.css @@ -151,8 +151,8 @@ transform: scaleX(-1); } -.pageAction-sendToDevice-device[clientType=mobile] { - list-style-image: url("chrome://browser/skin/device-mobile.svg"); +.pageAction-sendToDevice-device[clientType=phone] { + list-style-image: url("chrome://browser/skin/device-phone.svg"); } .pageAction-sendToDevice-device[clientType=tablet] { diff --git a/browser/themes/windows/jar.mn b/browser/themes/windows/jar.mn index 150d922487e1..e391da562593 100644 --- a/browser/themes/windows/jar.mn +++ b/browser/themes/windows/jar.mn @@ -16,8 +16,6 @@ browser.jar: * skin/classic/browser/searchbar.css skin/classic/browser/setDesktopBackground.css skin/classic/browser/slowStartup-16.png - skin/classic/browser/sync-desktopIcon.svg (../shared/sync-desktopIcon.svg) - skin/classic/browser/sync-mobileIcon.svg (../shared/sync-mobileIcon.svg) skin/classic/browser/webRTC-indicator.css (../shared/webRTC-indicator.css) * skin/classic/browser/controlcenter/panel.css (controlcenter/panel.css) skin/classic/browser/customizableui/menu-arrow.svg (customizableui/menu-arrow.svg) diff --git a/services/sync/modules/SyncedTabs.jsm b/services/sync/modules/SyncedTabs.jsm index 4933912b8412..e7a17b00ae5f 100644 --- a/services/sync/modules/SyncedTabs.jsm +++ b/services/sync/modules/SyncedTabs.jsm @@ -76,7 +76,7 @@ let SyncedTabsInternal = { id: client.id, type: "client", name: Weave.Service.clientsEngine.getClientName(client.id), - isMobile: Weave.Service.clientsEngine.isMobile(client.id), + clientType: Weave.Service.clientsEngine.getClientType(client.id), lastModified: client.lastModified * 1000, // sec to ms tabs: [] }; diff --git a/services/sync/modules/engines/clients.js b/services/sync/modules/engines/clients.js index 775bfdbb2fba..be54430d1034 100644 --- a/services/sync/modules/engines/clients.js +++ b/services/sync/modules/engines/clients.js @@ -232,10 +232,15 @@ ClientEngine.prototype = { return null; }, - isMobile: function isMobile(id) { - if (this._store._remoteClients[id]) - return this._store._remoteClients[id].type == DEVICE_TYPE_MOBILE; - return false; + getClientType(id) { + const client = this._store._remoteClients[id]; + if (client.type == DEVICE_TYPE_DESKTOP) { + return "desktop"; + } + if (client.formfactor && client.formfactor.includes("tablet")) { + return "tablet" + } + return "phone"; }, async _readCommands() { diff --git a/toolkit/components/places/PlacesRemoteTabsAutocompleteProvider.jsm b/toolkit/components/places/PlacesRemoteTabsAutocompleteProvider.jsm index 0629f35169c3..ee685c6cbaef 100644 --- a/toolkit/components/places/PlacesRemoteTabsAutocompleteProvider.jsm +++ b/toolkit/components/places/PlacesRemoteTabsAutocompleteProvider.jsm @@ -135,7 +135,7 @@ var PlacesRemoteTabsAutocompleteProvider = { // create the record we return for auto-complete. let record = { url, title, icon, - deviceClass: Weave.Service.clientsEngine.isMobile(clientId) ? "mobile" : "desktop", + deviceClass: Weave.Service.clientsEngine.getClientType(clientId), deviceName: client.clientName, }; matches.push(record);