OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var MIN_VERSION_TAB_CLOSE = 25; | 5 var MIN_VERSION_TAB_CLOSE = 25; |
6 var MIN_VERSION_TARGET_ID = 26; | 6 var MIN_VERSION_TARGET_ID = 26; |
7 var MIN_VERSION_NEW_TAB = 29; | 7 var MIN_VERSION_NEW_TAB = 29; |
8 var MIN_VERSION_TAB_ACTIVATE = 30; | 8 var MIN_VERSION_TAB_ACTIVATE = 30; |
9 | 9 |
10 var queryParamsObject = {}; | 10 var queryParamsObject = {}; |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 }.bind(null, openHandler), true); | 323 }.bind(null, openHandler), true); |
324 | 324 |
325 var newPageButton = document.createElement('button'); | 325 var newPageButton = document.createElement('button'); |
326 newPageButton.textContent = 'Open'; | 326 newPageButton.textContent = 'Open'; |
327 newPage.appendChild(newPageButton); | 327 newPage.appendChild(newPageButton); |
328 newPageButton.addEventListener('click', openHandler, true); | 328 newPageButton.addEventListener('click', openHandler, true); |
329 | 329 |
330 browserHeader.appendChild(newPage); | 330 browserHeader.appendChild(newPage); |
331 } | 331 } |
332 | 332 |
333 if (queryParamsObject['browser-inspector']) { | 333 var browserInspector; |
| 334 var browserInspectorTitle; |
| 335 if ('trace' in queryParamsObject || 'tracing' in queryParamsObject) { |
| 336 browserInspector = 'chrome://tracing'; |
| 337 browserInspectorTitle = 'trace'; |
| 338 } else { |
| 339 browserInspector = queryParamsObject['browser-inspector']; |
| 340 browserInspectorTitle = 'inspect'; |
| 341 } |
| 342 if (browserInspector) { |
334 var link = document.createElement('span'); | 343 var link = document.createElement('span'); |
335 link.classList.add('action'); | 344 link.classList.add('action'); |
336 link.setAttribute('tabindex', 1); | 345 link.setAttribute('tabindex', 1); |
337 link.textContent = 'inspect'; | 346 link.textContent = browserInspectorTitle; |
338 browserHeader.appendChild(link); | 347 browserHeader.appendChild(link); |
339 link.addEventListener( | 348 link.addEventListener( |
340 'click', | 349 'click', |
341 sendCommand.bind(null, 'inspect-browser', browser.source, | 350 sendCommand.bind(null, 'inspect-browser', browser.source, |
342 browser.id, queryParamsObject['browser-inspector']), false); | 351 browser.id, browserInspector), false); |
343 } | 352 } |
344 | 353 |
345 pageList = document.createElement('div'); | 354 pageList = document.createElement('div'); |
346 pageList.className = 'list pages'; | 355 pageList.className = 'list pages'; |
347 browserSection.appendChild(pageList); | 356 browserSection.appendChild(pageList); |
348 } | 357 } |
349 | 358 |
350 if (incompatibleVersion || alreadyDisplayed(browserSection, browser)) | 359 if (incompatibleVersion || alreadyDisplayed(browserSection, browser)) |
351 continue; | 360 continue; |
352 | 361 |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 deviceSection.querySelector('.device-ports').textContent = ''; | 935 deviceSection.querySelector('.device-ports').textContent = ''; |
927 } | 936 } |
928 | 937 |
929 Array.prototype.forEach.call( | 938 Array.prototype.forEach.call( |
930 document.querySelectorAll('.device'), clearPorts); | 939 document.querySelectorAll('.device'), clearPorts); |
931 } | 940 } |
932 | 941 |
933 document.addEventListener('DOMContentLoaded', onload); | 942 document.addEventListener('DOMContentLoaded', onload); |
934 | 943 |
935 window.addEventListener('hashchange', onHashChange); | 944 window.addEventListener('hashchange', onHashChange); |
OLD | NEW |