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