Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(586)

Side by Side Diff: chrome/browser/resources/about_memory_linux.html

Issue 7215034: Apply CSP to chrome: and about: pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 2
3 <!-- 3 <!--
4 about:memory template page 4 about:memory template page
5 --> 5 -->
6 <html id="t"> 6 <html id="t">
7 <head> 7 <head>
8 <title>About Memory</title> 8 <title>About Memory</title>
9 <link rel="stylesheet" href="shared/css/about_memory.css"> 9 <meta http-equiv="X-WebKit-CSP" content="object-src 'none'; script-src chrome: //resources 'self' 'unsafe-eval'">
10 <link rel="stylesheet" href="shared/css/about_memory.css">
10 11
11 <style> 12 <style>
12 body { 13 body {
13 font-family: Arial, Helvetica, sans-serif; 14 font-family: Arial, Helvetica, sans-serif;
14 } 15 }
15 div#header select { 16 div#header select {
16 font-family: Arial, Helvetica, sans-serif; 17 font-family: Arial, Helvetica, sans-serif;
17 } 18 }
18 div.viewOptions input { 19 div.viewOptions input {
19 font-family: Arial, Helvetica, sans-serif; 20 font-family: Arial, Helvetica, sans-serif;
20 } 21 }
21 div.otherbrowsers { 22 div.otherbrowsers {
22 font-family: Arial, Helvetica, sans-serif; 23 font-family: Arial, Helvetica, sans-serif;
23 } 24 }
24 table.list#browserComparison tr:not([class*='firstRow']) > *:nth-child(1), 25 table.list#browserComparison tr:not([class*='firstRow']) > *:nth-child(1),
25 table.list#browserComparison tr:not([class*='firstRow']) > *:nth-child(4), 26 table.list#browserComparison tr:not([class*='firstRow']) > *:nth-child(4),
26 table.list#browserComparison tr.firstRow th:nth-child(1) { 27 table.list#browserComparison tr.firstRow th:nth-child(1) {
27 border-right: 1px solid #b5c6de; 28 border-right: 1px solid #b5c6de;
28 } 29 }
29 table.list#memoryDetails tr:not([class*='firstRow']) > *:nth-child(2), 30 table.list#memoryDetails tr:not([class*='firstRow']) > *:nth-child(2),
30 table.list#memoryDetails tr:not([class*='firstRow']) > *:nth-child(5), 31 table.list#memoryDetails tr:not([class*='firstRow']) > *:nth-child(5),
31 table.list#memoryDetails tr.firstRow th:nth-child(2) { 32 table.list#memoryDetails tr.firstRow th:nth-child(2) {
32 border-right: 1px solid #b5c6de; 33 border-right: 1px solid #b5c6de;
33 } 34 }
34 </style> 35 </style>
35 <script> 36 <script src="chrome://memory-redirect/memory.js"></script>
36 function reload() { 37 <script src="chrome://memory-redirect/strings.js"></script>
37 if (document.getElementById('helpTooltip'))
38 return;
39 history.go(0);
40 }
41
42 function formatNumber(str) {
43 str += '';
44 if (str == '0') {
45 return 'N/A ';
46 }
47 var x = str.split('.');
48 var x1 = x[0];
49 var x2 = x.length > 1 ? '.' + x[1] : '';
50 var regex = /(\d+)(\d{3})/;
51 while (regex.test(x1)) {
52 x1 = x1.replace(regex, '$1' + ',' + '$2');
53 }
54 return x1;
55 }
56
57 function addToSum(id, value) {
58 var target = document.getElementById(id);
59 var sum = parseInt(target.innerHTML);
60 sum += parseInt(value);
61 target.innerHTML = sum;
62 }
63
64 function handleHelpTooltipMouseOver(event) {
65 var el = document.createElement('div');
66 el.id = 'helpTooltip';
67 el.innerHTML = event.toElement.getElementsByTagName('div')[0].innerHTML;
68 el.style.top = 0;
69 el.style.left = 0;
70 el.style.visibility = 'hidden';
71 document.body.appendChild(el);
72
73 var width = el.offsetWidth;
74 var height = el.offsetHeight;
75
76 if (event.pageX - width - 50 + document.body.scrollLeft >= 0 ) {
77 el.style.left = (event.pageX - width - 20) + 'px';
78 } else {
79 el.style.left = (event.pageX + 20) + 'px';
80 }
81
82
83 if (event.pageY - height - 50 + document.body.scrollTop >= 0) {
84 el.style.top = (event.pageY - height - 20) + 'px';
85 } else {
86 el.style.top = (event.pageY + 20) + 'px';
87 }
88
89 el.style.visibility = 'visible';
90 }
91
92 function handleHelpTooltipMouseOut(event) {
93 var el = document.getElementById('helpTooltip');
94 el.parentNode.removeChild(el);
95 }
96
97 function enableHelpTooltips() {
98 var helpEls = document.getElementsByClassName('help');
99
100 for (var i = 0, helpEl; helpEl = helpEls[i]; i++) {
101 helpEl.onmouseover = handleHelpTooltipMouseOver;
102 helpEl.onmouseout = handleHelpTooltipMouseOut;
103 }
104 }
105
106 //setInterval("reload()", 10000);
107 </script>
108 </head> 38 </head>
109 <body> 39 <body>
110 <div id='header'> 40 <div id='header'>
111 <h1> 41 <h1>
112 About memory 42 About memory
113 </h1> 43 </h1>
114 <p> 44 <p>
115 Measuring memory usage in a multi-process browser 45 Measuring memory usage in a multi-process browser
116 </p> 46 </p>
117 </div> 47 </div>
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 <tr class='noResults'> 219 <tr class='noResults'>
290 <td colspan='99'> 220 <td colspan='99'>
291 No results found. 221 No results found.
292 </td> 222 </td>
293 </tr> 223 </tr>
294 </table> 224 </table>
295 225
296 <div class="otherbrowsers">(The memory usage of our renderer processes is slightly less accurate when they are sandboxed.)</div> 226 <div class="otherbrowsers">(The memory usage of our renderer processes is slightly less accurate when they are sandboxed.)</div>
297 227
298 </div> 228 </div>
229 <script src="chrome://resources/js/jstemplate_compiled.js"></script>
299 </body> 230 </body>
300 <script>
301 enableHelpTooltips();
302 </script>
303 </html> 231 </html>
OLDNEW
« no previous file with comments | « chrome/browser/resources/about_memory.js ('k') | chrome/browser/resources/about_memory_mac.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698