Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 /** | 5 /** |
| 6 * Main entry point called once the page has loaded. | 6 * Main entry point called once the page has loaded. |
| 7 */ | 7 */ |
| 8 function onLoad() { | 8 function onLoad() { |
| 9 NetExportView.getInstance(); | 9 NetExportView.getInstance(); |
| 10 } | 10 } |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 | 91 |
| 92 // Disable all controls. Useable controls are enabled below. | 92 // Disable all controls. Useable controls are enabled below. |
| 93 var controls = document.querySelectorAll('button, input'); | 93 var controls = document.querySelectorAll('button, input'); |
| 94 for (var i = 0; i < controls.length; ++i) { | 94 for (var i = 0; i < controls.length; ++i) { |
| 95 controls[i].disabled = true; | 95 controls[i].disabled = true; |
| 96 } | 96 } |
| 97 | 97 |
| 98 $('export-view-deletes-log-text').hidden = true; | 98 $('export-view-deletes-log-text').hidden = true; |
| 99 $('export-view-private-data-text').hidden = true; | 99 $('export-view-private-data-text').hidden = true; |
| 100 $('export-view-send-old-log-text').hidden = true; | 100 $('export-view-send-old-log-text').hidden = true; |
| 101 if (exportNetLogInfo.state == 'NOT_LOGGING') { | 101 if (exportNetLogInfo.state == 'NOT_LOGGING') { |
|
eroman
2017/01/11 19:18:39
For the record, there are now additional values fo
wangyix1
2017/01/14 02:15:47
Yes this is correct. The two new possible values a
| |
| 102 // Allow making a new log. | 102 // Allow making a new log. |
| 103 $('export-view-strip-private-data-button').disabled = false; | 103 $('export-view-strip-private-data-button').disabled = false; |
| 104 $('export-view-include-private-data-button').disabled = false; | 104 $('export-view-include-private-data-button').disabled = false; |
| 105 $('export-view-log-bytes-button').disabled = false; | 105 $('export-view-log-bytes-button').disabled = false; |
| 106 $('export-view-start-data').disabled = false; | 106 $('export-view-start-data').disabled = false; |
| 107 | 107 |
| 108 // If there's an existing log, allow sending it. | 108 // If there's an existing log, allow sending it. |
| 109 if (exportNetLogInfo.logType != 'NONE') { | 109 if (!!exportNetLogInfo.logExists) { |
| 110 $('export-view-deletes-log-text').hidden = false; | 110 $('export-view-deletes-log-text').hidden = false; |
| 111 $('export-view-send-data').disabled = false; | 111 $('export-view-send-data').disabled = false; |
| 112 if (exportNetLogInfo.logType == 'UNKNOWN') { | 112 if (!exportNetLogInfo.logCaptureModeKnown) { |
| 113 $('export-view-send-old-log-text').hidden = false; | 113 $('export-view-send-old-log-text').hidden = false; |
| 114 } else if (exportNetLogInfo.logType == 'NORMAL') { | 114 } else if (exportNetLogInfo.captureMode == 'NORMAL') { |
| 115 $('export-view-private-data-text').hidden = false; | 115 $('export-view-private-data-text').hidden = false; |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 } else if (exportNetLogInfo.state == 'LOGGING') { | 118 } else if (exportNetLogInfo.state == 'LOGGING') { |
| 119 // Only possible to stop logging. Radio buttons reflects current state. | 119 // Only possible to stop logging. Radio buttons reflects current state. |
| 120 document.querySelector('input[name="log-mode"][value="' + | 120 document.querySelector('input[name="log-mode"][value="' + |
| 121 exportNetLogInfo.logType + '"]').checked = true; | 121 exportNetLogInfo.captureMode + '"]').checked = true; |
| 122 $('export-view-stop-data').disabled = false; | 122 $('export-view-stop-data').disabled = false; |
| 123 } else if (exportNetLogInfo.state == 'UNINITIALIZED') { | 123 } else if (exportNetLogInfo.state == 'UNINITIALIZED') { |
| 124 $('export-view-file-path-text').textContent = | 124 $('export-view-file-path-text').textContent = |
| 125 'Unable to initialize NetLog data file.'; | 125 'Unable to initialize NetLog data file.'; |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 return NetExportView; | 130 return NetExportView; |
| 131 })(); | 131 })(); |
| OLD | NEW |