summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/gpu_internals.html
blob: bdcea10ccefff9f26f5f4cd6bcbb574b892f7776 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!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 i18n-values="dir:textdirection;">
<link rel="stylesheet" href="webui.css">
<style>
* {
  box-sizing: border-box;
}

html, body, #main-tabs {
  height: 100%;
}

body {
  cursor: default;
  font-family: sans-serif;
  padding: 0;
  margin: 0;
}
</style>
<link rel="stylesheet" href="gpu_internals/tab_control.css">
<link rel="stylesheet" href="gpu_internals/info_view.css">
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/cr/event_target.js"></script>
<script src="chrome://resources/js/cr/ui.js"></script>
<script src="chrome://resources/js/util.js"></script>
<script src="gpu_internals/tab_control.js"></script>
<script src="gpu_internals/browser_bridge.js"></script>
<script src="gpu_internals/info_view.js"></script>


<script>
var browser;

/**
 * Main entry point. called once the page has loaded.
 */
function onLoad() {
  browserBridge = new gpu.BrowserBridge();

  // Create the views.
  cr.ui.decorate('#info-view', gpu.InfoView);

  // Create the main tab control
  var tabs = $('main-tabs');
  cr.ui.decorate(tabs, gpu.TabControl);

  // Sync the main-tabs selectedTabs in-sync with the location.
  tabs.addEventListener('selectedTabChanged', function() {
    if (tabs.selectedTab.id) {
      history.pushState('', '', '#' + tabs.selectedTab.id);
    }
  });
  window.onhashchange = function() {
    var cur = window.location.hash;
    if (cur == '#' || cur == '') {
      if (tabs.tabs.length)
        tabs.selectedTab = tabs.tabs[0];
    } else {
      var tab = $(window.location.hash.substr(1));
      if (tab)
        tabs.selectedTab = tab;
    }
  };
  window.onhashchange();
}

document.addEventListener('DOMContentLoaded', onLoad);

</script>
</head>
<body>
  <!-- Tabs -->
  <div id="main-tabs">
    <include src="gpu_internals/info_view.html">
  </div>
</body>
</html>