OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 <include src="gpu_internals/overlay.js"/> |
| 6 <include src="gpu_internals/browser_bridge.js"/> |
| 7 <include src="gpu_internals/tracing_controller.js"/> |
| 8 <include src="gpu_internals/info_view.js"/> |
| 9 <include src="gpu_internals/timeline_model.js"/> |
| 10 <include src="gpu_internals/sorted_array_utils.js"/> |
| 11 <include src="gpu_internals/timeline.js"/> |
| 12 <include src="gpu_internals/timeline_track.js"/> |
| 13 <include src="gpu_internals/fast_rect_renderer.js"/> |
| 14 <include src="gpu_internals/profiling_view.js"/> |
| 15 <include src="gpu_internals/timeline_view.js"/> |
| 16 |
| 17 var browserBridge; |
| 18 var tracingController; |
| 19 var timelineView; // made global for debugging purposes only |
| 20 var profilingView; // made global for debugging purposes only |
| 21 |
| 22 /** |
| 23 * Main entry point. called once the page has loaded. |
| 24 */ |
| 25 function onLoad() { |
| 26 browserBridge = new gpu.BrowserBridge(); |
| 27 tracingController = new gpu.TracingController(); |
| 28 |
| 29 // Create the views. |
| 30 cr.ui.decorate('#info-view', gpu.InfoView); |
| 31 |
| 32 profilingView = $('profiling-view'); |
| 33 cr.ui.decorate(profilingView, gpu.ProfilingView); |
| 34 |
| 35 // Create the main tab control |
| 36 var tabs = $('main-tabs'); |
| 37 cr.ui.decorate(tabs, cr.ui.TabBox); |
| 38 |
| 39 // Sync the main-tabs selectedTabs in-sync with the location. |
| 40 tabs.addEventListener('selectedChange', function() { |
| 41 if (tabs.selectedTab.id) { |
| 42 history.pushState('', '', '#' + tabs.selectedTab.id); |
| 43 } |
| 44 }); |
| 45 window.onhashchange = function() { |
| 46 var cur = window.location.hash; |
| 47 if (cur == '#' || cur == '') { |
| 48 tabs.selectedTab = $('info-view'); |
| 49 } else { |
| 50 var tab = $(window.location.hash.substr(1)); |
| 51 if (tab) |
| 52 tabs.selectedTab = tab; |
| 53 } |
| 54 }; |
| 55 window.onhashchange(); |
| 56 } |
| 57 |
| 58 document.addEventListener('DOMContentLoaded', onLoad); |
OLD | NEW |