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

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

Issue 2502863002: Add UI DevTools under chrome://inspect/#other (Closed)
Patch Set: feedback Created 4 years, 1 month 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 | chrome/browser/ui/BUILD.gn » ('j') | 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 f0bfd203c8b236cb31063434cfbbc78a85b1df35..e5643f1c0cec3fb169dfa7b10b400460321ab1ac 100644
--- a/chrome/browser/resources/inspect/inspect.js
+++ b/chrome/browser/resources/inspect/inspect.js
@@ -44,6 +44,20 @@ function removeChildren(element_id) {
element.textContent = '';
}
+function removeAdditionalChildren(element_id) {
+ var element = $(element_id);
+ var elements = element.querySelectorAll('.row.additional');
+ for (var i = 0; i != elements.length; i++)
+ element.removeChild(elements[i]);
+}
+
+function removeChildrenExceptAdditional(element_id) {
+ var element = $(element_id);
+ var elements = element.querySelectorAll('.row:not(.additional)');
+ for (var i = 0; i != elements.length; i++)
+ element.removeChild(elements[i]);
+}
+
function onload() {
var tabContents = document.querySelectorAll('#content > div');
for (var i = 0; i != tabContents.length; i++) {
@@ -104,13 +118,19 @@ function populateTargets(source, data) {
console.error('Unknown source type: ' + source);
}
+function populateAdditionalTargets(data) {
+ removeAdditionalChildren('others-list');
+ for (var i = 0; i < data.length; i++)
+ addAdditionalTargetsToOthersList(data[i]);
+}
+
function populateLocalTargets(data) {
removeChildren('pages-list');
removeChildren('extensions-list');
removeChildren('apps-list');
- removeChildren('others-list');
removeChildren('workers-list');
removeChildren('service-workers-list');
+ removeChildrenExceptAdditional('others-list');
for (var i = 0; i < data.length; i++) {
if (data[i].type === 'page')
@@ -428,6 +448,10 @@ function addToOthersList(data) {
addTargetToList(data, $('others-list'), ['url']);
}
+function addAdditionalTargetsToOthersList(data) {
+ addTargetToList(data, $('others-list'), ['name', 'url']);
+}
+
function formatValue(data, property) {
var value = data[property];
@@ -567,7 +591,11 @@ function addTargetToList(data, list, properties) {
actionBox.className = 'actions';
subrowBox.appendChild(actionBox);
- if (!data.hasCustomInspectAction) {
+ if (data.isAdditional) {
+ addActionLink(row, 'inspect',
+ sendCommand.bind(null, 'inspect-additional', data.url), false);
+ row.classList.add('additional');
+ } else if (!data.hasCustomInspectAction) {
addActionLink(row, 'inspect', sendTargetCommand.bind(null, 'inspect', data),
data.hasNoUniqueId || data.adbAttachedForeign);
}
« no previous file with comments | « no previous file | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698