OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 function toggleHelpBox() { | 5 function toggleHelpBox() { |
6 var helpBoxOuter = document.getElementById('details'); | 6 var helpBoxOuter = document.getElementById('details'); |
7 helpBoxOuter.classList.toggle('hidden'); | 7 helpBoxOuter.classList.toggle('hidden'); |
8 var detailsButton = document.getElementById('details-button'); | 8 var detailsButton = document.getElementById('details-button'); |
9 if (helpBoxOuter.classList.contains('hidden')) | 9 if (helpBoxOuter.classList.contains('hidden')) |
10 detailsButton.innerText = detailsButton.detailsText; | 10 detailsButton.innerText = detailsButton.detailsText; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 */ | 118 */ |
119 function setUpCachedButton(buttonStrings) { | 119 function setUpCachedButton(buttonStrings) { |
120 var reloadButton = document.getElementById('reload-button'); | 120 var reloadButton = document.getElementById('reload-button'); |
121 | 121 |
122 reloadButton.textContent = buttonStrings.msg; | 122 reloadButton.textContent = buttonStrings.msg; |
123 var url = buttonStrings.cacheUrl; | 123 var url = buttonStrings.cacheUrl; |
124 var trackingId = buttonStrings.trackingId; | 124 var trackingId = buttonStrings.trackingId; |
125 reloadButton.onclick = function(e) { | 125 reloadButton.onclick = function(e) { |
126 e.preventDefault(); | 126 e.preventDefault(); |
127 trackClick(trackingId); | 127 trackClick(trackingId); |
| 128 if (window.errorPageController) { |
| 129 errorPageController.trackCachedCopyButtonClick( |
| 130 buttonStrings.defaultLabel); |
| 131 } |
128 location = url; | 132 location = url; |
129 }; | 133 }; |
130 reloadButton.style.display = ''; | 134 reloadButton.style.display = ''; |
131 document.getElementById('control-buttons').hidden = false; | 135 document.getElementById('control-buttons').hidden = false; |
132 } | 136 } |
133 | 137 |
134 var primaryControlOnLeft = true; | 138 var primaryControlOnLeft = true; |
135 <if expr="is_macosx or is_ios or is_linux or is_android"> | 139 <if expr="is_macosx or is_ios or is_linux or is_android"> |
136 primaryControlOnLeft = false; | 140 primaryControlOnLeft = false; |
137 </if> | 141 </if> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 p.hidden = false; | 200 p.hidden = false; |
197 } | 201 } |
198 | 202 |
199 // Check for Google cached copy suggestion. | 203 // Check for Google cached copy suggestion. |
200 if (loadTimeData.valueExists('cacheButton')) { | 204 if (loadTimeData.valueExists('cacheButton')) { |
201 setUpCachedButton(loadTimeData.getValue('cacheButton')); | 205 setUpCachedButton(loadTimeData.getValue('cacheButton')); |
202 } | 206 } |
203 } | 207 } |
204 | 208 |
205 document.addEventListener('DOMContentLoaded', onDocumentLoad); | 209 document.addEventListener('DOMContentLoaded', onDocumentLoad); |
OLD | NEW |