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 cr.define('hungRendererDialog', function() { | 5 cr.define('hungRendererDialog', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * Disables the controls while the dialog is busy. | 9 * Disables the controls while the dialog is busy. |
10 */ | 10 */ |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 $('kill').onclick = function() { | 49 $('kill').onclick = function() { |
50 closeWithResult(true); | 50 closeWithResult(true); |
51 } | 51 } |
52 | 52 |
53 $('wait').onclick = function() { | 53 $('wait').onclick = function() { |
54 closeWithResult(false); | 54 closeWithResult(false); |
55 } | 55 } |
56 | 56 |
57 if (cr.isViews) | 57 if (cr.isViews) |
58 forEach(document.querySelectorAll('.button-strip'), reverseChildren); | 58 forEach(document.querySelectorAll('.button-strip'), reverseChildren); |
59 chrome.send('requestTabContentsList'); | 59 chrome.send('requestTabContentsList') |
60 } | 60 } |
61 | 61 |
62 /** | 62 /** |
63 * Adds elements to the DOM to populate the tab contents list box area of the | 63 * Adds elements to the DOM to populate the tab contents list box area of the |
64 * dialog. Substitutes the favicon source and title text from the details | 64 * dialog. Substitutes the favicon source and title text from the details |
65 * using a template mechanism (clones hidden parts of the dialog DOM). | 65 * using a template mechanism (clones hidden parts of the dialog DOM). |
66 * @param {Array.<{title: string, url: string}>} tabDetailsList Array of tab | 66 * @param {Array.<{title: string, url: string}>} tabDetailsList Array of tab |
67 * contents detail objects containing |url| and |title| for each frozen | 67 * contents detail objects containing |url| and |title| for each frozen |
68 * tab. | 68 * tab. |
69 */ | 69 */ |
70 function setTabContentsList(tabDetailsList) { | 70 function setTabContentsList(tabDetailsList) { |
71 var numTabs = tabDetailsList.length; | 71 var numTabs = tabDetailsList.length; |
72 for (var i = 0; i < numTabs; i++) { | 72 for (var i = 0; i < numTabs; i++) { |
73 var listItem = document.createElement('li'); | 73 var listItem = document.createElement('li'); |
74 listItem.style.backgroundImage = url('chrome://favicon/size/32/' + | 74 listItem.style.backgroundImage = url('chrome://favicon/size/32/' + |
75 tabDetailsList[i].url); | 75 tabDetailsList[i].url); |
76 listItem.textContent = tabDetailsList[i].title; | 76 listItem.textContent = tabDetailsList[i].title; |
77 $('tab-table').appendChild(listItem); | 77 $('tab-table').appendChild(listItem) |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 return { | 81 return { |
82 initialize: initialize, | 82 initialize: initialize, |
83 setTabContentsList: setTabContentsList, | 83 setTabContentsList: setTabContentsList, |
84 }; | 84 }; |
85 }); | 85 }); |
86 | 86 |
87 document.addEventListener('DOMContentLoaded', hungRendererDialog.initialize); | 87 document.addEventListener('DOMContentLoaded', hungRendererDialog.initialize); |
OLD | NEW |