OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * @constructor | 8 * @constructor |
9 */ | 9 */ |
10 function MessageWindowImpl() { | 10 function MessageWindowImpl() { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 typeof(showSpinner) != 'boolean') { | 98 typeof(showSpinner) != 'boolean') { |
99 console.log('Bad show message:', event.data); | 99 console.log('Bad show message:', event.data); |
100 break; | 100 break; |
101 } | 101 } |
102 | 102 |
103 // Set the dialog text. | 103 // Set the dialog text. |
104 var button = document.getElementById('button-primary'); | 104 var button = document.getElementById('button-primary'); |
105 var cancelButton = document.getElementById('button-secondary'); | 105 var cancelButton = document.getElementById('button-secondary'); |
106 var messageDiv = document.getElementById('message'); | 106 var messageDiv = document.getElementById('message'); |
107 var infoboxDiv = document.getElementById('infobox'); | 107 var infoboxDiv = document.getElementById('infobox'); |
| 108 |
108 document.getElementById('title').innerText = title; | 109 document.getElementById('title').innerText = title; |
109 document.querySelector('title').innerText = title; | 110 document.querySelector('title').innerText = title; |
110 messageDiv.innerText = message; | 111 messageDiv.innerHTML = message; |
| 112 |
111 if (showSpinner) { | 113 if (showSpinner) { |
112 messageDiv.classList.add('waiting'); | 114 messageDiv.classList.add('waiting'); |
113 messageDiv.classList.add('prominent'); | 115 messageDiv.classList.add('prominent'); |
114 } | 116 } |
115 if (infobox != '') { | 117 if (infobox != '') { |
116 infoboxDiv.innerText = infobox; | 118 infoboxDiv.innerText = infobox; |
117 } else { | 119 } else { |
118 infoboxDiv.hidden = true; | 120 infoboxDiv.hidden = true; |
119 } | 121 } |
120 | 122 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 156 |
155 this.updateSize_(); | 157 this.updateSize_(); |
156 break; | 158 break; |
157 | 159 |
158 default: | 160 default: |
159 console.error('Unexpected message:', event.data); | 161 console.error('Unexpected message:', event.data); |
160 } | 162 } |
161 }; | 163 }; |
162 | 164 |
163 var messageWindow = new MessageWindowImpl(); | 165 var messageWindow = new MessageWindowImpl(); |
OLD | NEW |