Index: chrome/browser/resources/gpu_internals.html |
=================================================================== |
--- chrome/browser/resources/gpu_internals.html (revision 0) |
+++ chrome/browser/resources/gpu_internals.html (revision 0) |
@@ -0,0 +1,81 @@ |
+<!DOCTYPE HTML> |
+<html> |
+<!-- |
+Copyright (c) 2010 The Chromium Authors. All rights reserved. |
+Use of this source code is governed by a BSD-style license that can be |
+found in the LICENSE file. |
+--> |
+<head> |
+<link rel="stylesheet" href="dom_ui.css"> |
+<link rel="stylesheet" href="net_internals/tabswitcherview.css"> |
+<link rel="stylesheet" href="gpu_internals/info_view.css"> |
+<script src="chrome://resources/js/cr.js"></script> |
+<script src="net_internals/util.js"></script> |
+<script src="net_internals/view.js"></script> |
+<script src="net_internals/tabswitcherview.js"></script> |
+<script src="gpu_internals/browser_bridge.js"></script> |
+<script src="gpu_internals/info_view.js"></script> |
+ |
+<script> |
+var g_browser = null; |
arv (Not doing code reviews)
2010/12/03 22:19:20
var browser;
nduca
2010/12/03 22:49:39
Done.
|
+ |
+/** |
+ * Main entry point. called once the page has loaded. |
+ */ |
+function onLoaded() { |
+ g_browser = new gpu.BrowserBridge(); |
+ |
+ // Create a view which will display general information |
+ // about the gpu. |
+ var infoView = new InfoView('info-tab-content'); |
+ |
+ // Create a view which lets you tab between the different sub-views. |
+ var categoryTabSwitcher = |
+ new TabSwitcherView('category-tab-handles'); |
+ |
+ // Populate the main tabs. |
+ categoryTabSwitcher.addTab('info-tab', infoView, false); |
+ |
+ // Build a map from the anchor name of each tab handle to its 'tab ID'. |
+ // We will consider navigations to the #hash as a switch tab request. |
+ var anchorMap = {}; |
+ var tabIds = categoryTabSwitcher.getAllTabIds(); |
+ for (var i = 0; i < tabIds.length; ++i) { |
+ var aNode = document.getElementById(tabIds[i]); |
+ anchorMap[aNode.hash] = tabIds[i]; |
+ } |
+ // Default the empty hash to the info tab. |
+ anchorMap['#'] = anchorMap[''] = 'info-tab'; |
+ |
+ window.onhashchange = function() { |
+ var tabId = anchorMap[window.location.hash]; |
+ if (tabId) |
+ categoryTabSwitcher.switchToTab(tabId); |
+ }; |
+ |
+ // Make this category tab widget the primary view, that fills the whole page. |
+ var windowView = new WindowView(categoryTabSwitcher); |
+ |
+ // Trigger initial layout. |
arv (Not doing code reviews)
2010/12/03 22:19:20
Would it be too much to get rid of all the js layo
nduca
2010/12/03 22:49:39
You mean, let css do the layout rather than all th
|
+ windowView.resetGeometry(); |
+ |
+ // Select the initial view based on the current URL. |
+ window.onhashchange(); |
+} |
+document.addEventListener('DOMContentLoaded', load); |
+</script> |
+</head> |
+<body onload="load()"> |
arv (Not doing code reviews)
2010/12/03 22:19:20
why DOMContentLoaded and window.onload?
nduca
2010/12/03 22:49:39
hahaha thanks!
On 2010/12/03 22:19:20, arv wrote:
|
+ |
+ <!-- Tab switcher for main categories. --> |
+ <div id=category-tab-handles><a href="#info" id=info-tab>GPU Info</a></li> |
+ </ul> |
arv (Not doing code reviews)
2010/12/03 22:19:20
Invalid markup. This looks like some old cruft
nduca
2010/12/03 22:49:39
Holy crap, I suck.
On 2010/12/03 22:19:20, arv wro
|
+ </div> |
+ |
+ <!-- Tabs --> |
+ <div id=info-tab-content> |
+ <div id=info-text></div> |
+ </div> |
+ |
+</body> |
+</html> |