X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fchrome%2Fbrowser%2Fresources%2Finspect%2Finspect.js;h=33559673d63575266ef22be4aa5aef40b658bd64;hb=004985e17e624662a4c85c76a7654039dc83f028;hp=437758e41ed3c01f149d4752d31b51bde4de397c;hpb=2f108dbacb161091e42a3479f4e171339b7e7623;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/chrome/browser/resources/inspect/inspect.js b/src/chrome/browser/resources/inspect/inspect.js index 437758e..3355967 100644 --- a/src/chrome/browser/resources/inspect/inspect.js +++ b/src/chrome/browser/resources/inspect/inspect.js @@ -198,30 +198,6 @@ function populateRemoteTargets(devices) { device.adbConnected ? '' : 'Pending authentication: please accept ' + 'debugging session on the device.'; - var devicePorts = deviceSection.querySelector('.device-ports'); - devicePorts.textContent = ''; - if (device.adbPortStatus) { - for (var port in device.adbPortStatus) { - var status = device.adbPortStatus[port]; - var portIcon = document.createElement('div'); - portIcon.className = 'port-icon'; - if (status > 0) - portIcon.classList.add('connected'); - else if (status == -1 || status == -2) - portIcon.classList.add('transient'); - else if (status < 0) - portIcon.classList.add('error'); - devicePorts.appendChild(portIcon); - - var portNumber = document.createElement('div'); - portNumber.className = 'port-number'; - portNumber.textContent = ':' + port; - if (status > 0) - portNumber.textContent += '(' + status + ')'; - devicePorts.appendChild(portNumber); - } - } - var browserList = deviceSection.querySelector('.browsers'); var newBrowserIds = device.browsers.map(function(b) { return b.id }); @@ -516,6 +492,7 @@ function addTargetToList(data, list, properties) { function addActionLink(row, text, handler, opt_disabled) { var link = document.createElement('span'); link.classList.add('action'); + link.setAttribute('tabindex', 1); if (opt_disabled) link.classList.add('disabled'); else @@ -820,6 +797,55 @@ function commitFreshLineIfValid(opt_selectNew) { return true; } +function populatePortStatus(devicesStatusMap) { + for (var deviceId in devicesStatusMap) { + if (!devicesStatusMap.hasOwnProperty(deviceId)) + continue; + var deviceStatusMap = devicesStatusMap[deviceId]; + + var deviceSection = $(deviceId); + if (!deviceSection) + continue; + + var devicePorts = deviceSection.querySelector('.device-ports'); + devicePorts.textContent = ''; + for (var port in deviceStatusMap) { + if (!deviceStatusMap.hasOwnProperty(port)) + continue; + + var status = deviceStatusMap[port]; + var portIcon = document.createElement('div'); + portIcon.className = 'port-icon'; + // status === 0 is the default (connected) state. + // Positive values correspond to the tunnelling connection count + // (in DEBUG_DEVTOOLS mode). + if (status > 0) + portIcon.classList.add('connected'); + else if (status === -1 || status === -2) + portIcon.classList.add('transient'); + else if (status < 0) + portIcon.classList.add('error'); + devicePorts.appendChild(portIcon); + + var portNumber = document.createElement('div'); + portNumber.className = 'port-number'; + portNumber.textContent = ':' + port; + if (status > 0) + portNumber.textContent += '(' + status + ')'; + devicePorts.appendChild(portNumber); + } + } + + function clearPorts(deviceSection) { + if (deviceSection.id in devicesStatusMap) + return; + deviceSection.querySelector('.device-ports').textContent = ''; + } + + Array.prototype.forEach.call( + document.querySelectorAll('.device'), clearPorts); +} + document.addEventListener('DOMContentLoaded', onload); window.addEventListener('hashchange', onHashChange);