OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <!-- |
| 4 Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 5 Use of this source code is governed by a BSD-style license that can be |
| 6 found in the LICENSE file. |
| 7 --> |
| 8 <head i18n-values="dir:textdirection;"> |
| 9 <link rel="stylesheet" href="dom_ui.css"> |
| 10 <link rel="stylesheet" href="net_internals/tabswitcherview.css"> |
| 11 <style> |
| 12 * { |
| 13 box-sizing: border-box; |
| 14 } |
| 15 body { |
| 16 font-family: sans-serif; |
| 17 } |
| 18 </style> |
| 19 <link rel="stylesheet" href="gpu_internals/info_view.css"> |
| 20 <script src="chrome://resources/js/cr.js"></script> |
| 21 <script src="net_internals/util.js"></script> |
| 22 <script src="net_internals/view.js"></script> |
| 23 <script src="net_internals/tabswitcherview.js"></script> |
| 24 <script src="gpu_internals/browser_bridge.js"></script> |
| 25 <script src="gpu_internals/info_view.js"></script> |
| 26 |
| 27 |
| 28 <script> |
| 29 var browser = null; |
| 30 |
| 31 /** |
| 32 * Main entry point. called once the page has loaded. |
| 33 */ |
| 34 function onLoad() { |
| 35 browserBridge = new gpu.BrowserBridge(); |
| 36 |
| 37 // Create a view which will display general information |
| 38 // about the gpu. |
| 39 var infoView = new gpu.InfoView('info-view'); |
| 40 |
| 41 // Create a view which lets you tab between the different sub-views. |
| 42 var categoryTabSwitcher = |
| 43 new TabSwitcherView('category-tab-handles'); |
| 44 |
| 45 // Populate the main tabs. |
| 46 categoryTabSwitcher.addTab('info-tab', infoView, false); |
| 47 |
| 48 // Build a map from the anchor name of each tab handle to its 'tab ID'. |
| 49 // We will consider navigations to the #hash as a switch tab request. |
| 50 var anchorMap = {}; |
| 51 var tabIds = categoryTabSwitcher.getAllTabIds(); |
| 52 for (var i = 0; i < tabIds.length; i++) { |
| 53 var aNode = document.getElementById(tabIds[i]); |
| 54 anchorMap[aNode.hash] = tabIds[i]; |
| 55 } |
| 56 // Default the empty hash to the info tab. |
| 57 anchorMap['#'] = anchorMap[''] = 'info-tab'; |
| 58 |
| 59 window.onhashchange = function() { |
| 60 var tabId = anchorMap[window.location.hash]; |
| 61 if (tabId) |
| 62 categoryTabSwitcher.switchToTab(tabId); |
| 63 }; |
| 64 |
| 65 // Make this category tab widget the primary view, that fills the whole page. |
| 66 var windowView = new WindowView(categoryTabSwitcher); |
| 67 |
| 68 // Trigger initial layout. |
| 69 windowView.resetGeometry(); |
| 70 |
| 71 // Select the initial view based on the current URL. |
| 72 window.onhashchange(); |
| 73 } |
| 74 |
| 75 document.addEventListener('DOMContentLoaded', onLoad); |
| 76 |
| 77 </script> |
| 78 </head> |
| 79 <body> |
| 80 |
| 81 <!-- Tab switcher for main categories. --> |
| 82 <div id=category-tab-handles> |
| 83 <ul> |
| 84 <li><a href="#info" id="info-tab">GPU Info</a></li> |
| 85 </ul> |
| 86 </div> |
| 87 |
| 88 <!-- Tabs --> |
| 89 <include src="gpu_internals/info_view.html"> |
| 90 </body> |
| 91 </html> |
OLD | NEW |