Chromium Code Reviews| Index: chrome/browser/resources/inspect/inspect.js |
| diff --git a/chrome/browser/resources/inspect/inspect.js b/chrome/browser/resources/inspect/inspect.js |
| index 660eeace31a25ad7a7fdd22fde2029f7b8316175..2c1754b205ff7d71c7828d89a73d7ed3bdcff176 100644 |
| --- a/chrome/browser/resources/inspect/inspect.js |
| +++ b/chrome/browser/resources/inspect/inspect.js |
| @@ -22,6 +22,16 @@ for (var i = 0; i < params.length; ++i) { |
| })(); |
| +var browserInspector; |
| +var browserInspectorTitle; |
| +if ('trace' in queryParamsObject || 'tracing' in queryParamsObject) { |
|
dgozman
2015/01/14 14:12:01
Move the code inside anonymous function above.
vkuzkokov
2015/01/14 15:01:21
Done.
|
| + browserInspector = 'chrome://tracing'; |
| + browserInspectorTitle = 'trace'; |
| +} else { |
| + browserInspector = queryParamsObject['browser-inspector']; |
| + browserInspectorTitle = 'inspect'; |
| +} |
| + |
| function sendCommand(command, args) { |
| chrome.send(command, Array.prototype.slice.call(arguments, 1)); |
| } |
| @@ -296,15 +306,6 @@ function populateRemoteTargets(devices) { |
| browserSection.appendChild(warningSection); |
| } |
| - var browserInspector; |
| - var browserInspectorTitle; |
| - if ('trace' in queryParamsObject || 'tracing' in queryParamsObject) { |
| - browserInspector = 'chrome://tracing'; |
| - browserInspectorTitle = 'trace'; |
| - } else { |
| - browserInspector = queryParamsObject['browser-inspector']; |
| - browserInspectorTitle = 'inspect'; |
| - } |
| if (browserInspector) { |
| var link = document.createElement('span'); |
| link.classList.add('action'); |
| @@ -322,6 +323,14 @@ function populateRemoteTargets(devices) { |
| browserSection.appendChild(pageList); |
| } |
| + var portForwardingIcon = |
| + browserSection.querySelector('.used-for-port-forwarding'); |
| + |
| + browserSection.hidden = majorChromeVersion === 0 && |
| + browser.pages.length === 0 && |
| + !browserInspector && |
| + portForwardingIcon.hidden; |
| + |
| if (incompatibleVersion || alreadyDisplayed(browserSection, browser)) |
| continue; |
| @@ -907,6 +916,10 @@ function populatePortStatus(devicesStatusMap) { |
| } |
| function updatePortForwardingInfo(browserSection) { |
| + browserSection.hidden = !browserSection.querySelector('.open') && |
|
dgozman
2015/01/14 14:12:01
Please use the single function to update browserSe
vkuzkokov
2015/01/14 15:01:21
Done.
|
| + !browserSection.querySelector('.page') && |
| + !browserInspector && |
| + browserSection.id !== deviceStatus.browserId; |
| var icon = browserSection.querySelector('.used-for-port-forwarding'); |
| if (icon) |
| icon.hidden = (browserSection.id !== deviceStatus.browserId); |