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 timelineView; // made global for debugging purposes only | |
20 var profilingView; // made global for debugging purposes only | |
21 | 9 |
22 /** | 10 /** |
23 * Main entry point. called once the page has loaded. | 11 * Main entry point. called once the page has loaded. |
24 */ | 12 */ |
25 function onLoad() { | 13 function onLoad() { |
26 browserBridge = new gpu.BrowserBridge(); | 14 browserBridge = new gpu.BrowserBridge(); |
27 tracingController = new gpu.TracingController(); | |
28 | 15 |
29 // Create the views. | 16 // Create the views. |
30 cr.ui.decorate('#info-view', gpu.InfoView); | 17 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 } | 18 } |
57 | 19 |
58 document.addEventListener('DOMContentLoaded', onLoad); | 20 document.addEventListener('DOMContentLoaded', onLoad); |
OLD | NEW |