Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2126)

Unified Diff: chrome/browser/resources/inspect/inspect.js

Issue 818773005: [DevTools] Skip WebView instances without open pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698