| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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') { |
| 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 |
| 121 exportNetLogInfo.logType + '"]').checked = true; | 121 .querySelector( |
| 122 'input[name="log-mode"][value="' + |
| 123 exportNetLogInfo.captureMode + '"]') |
| 124 .checked = true; |
| 122 $('export-view-stop-data').disabled = false; | 125 $('export-view-stop-data').disabled = false; |
| 123 } else if (exportNetLogInfo.state == 'UNINITIALIZED') { | 126 } else if (exportNetLogInfo.state == 'UNINITIALIZED') { |
| 124 $('export-view-file-path-text').textContent = | 127 $('export-view-file-path-text').textContent = |
| 125 'Unable to initialize NetLog data file.'; | 128 'Unable to initialize NetLog data file.'; |
| 126 } | 129 } |
| 127 } | 130 } |
| 128 }; | 131 }; |
| 129 | 132 |
| 130 return NetExportView; | 133 return NetExportView; |
| 131 })(); | 134 })(); |
| OLD | NEW |