| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * This view displays options for exporting the captured data. | 6 * This view displays options for exporting the captured data. |
| 7 */ | 7 */ |
| 8 var ExportView = (function() { | 8 var ExportView = (function() { |
| 9 'use strict'; | 9 'use strict'; |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 ExportView.prototype = { | 59 ExportView.prototype = { |
| 60 // Inherit the superclass's methods. | 60 // Inherit the superclass's methods. |
| 61 __proto__: superClass.prototype, | 61 __proto__: superClass.prototype, |
| 62 | 62 |
| 63 /** | 63 /** |
| 64 * Depending on the value of the checkbox, enables or disables stripping | 64 * Depending on the value of the checkbox, enables or disables stripping |
| 65 * cookies and passwords from log dumps and displayed events. | 65 * cookies and passwords from log dumps and displayed events. |
| 66 */ | 66 */ |
| 67 onSetSecurityStripping_: function(securityStrippingCheckbox) { | 67 onSetSecurityStripping_: function(securityStrippingCheckbox) { |
| 68 g_browser.sourceTracker.setSecurityStripping( | 68 SourceTracker.getInstance().setSecurityStripping( |
| 69 securityStrippingCheckbox.checked); | 69 securityStrippingCheckbox.checked); |
| 70 }, | 70 }, |
| 71 | 71 |
| 72 /** | 72 /** |
| 73 * When loading a log dump, cache it for future export and continue showing | 73 * When loading a log dump, cache it for future export and continue showing |
| 74 * the ExportView. | 74 * the ExportView. |
| 75 */ | 75 */ |
| 76 onLoadLogFinish: function(polledData, tabData, logDump) { | 76 onLoadLogFinish: function(polledData, tabData, logDump) { |
| 77 this.loadedLogDump_ = logDump; | 77 this.loadedLogDump_ = logDump; |
| 78 this.setUserComments_(logDump.userComments); | 78 this.setUserComments_(logDump.userComments); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 */ | 123 */ |
| 124 createLogDump_: function(callback) { | 124 createLogDump_: function(callback) { |
| 125 // Get an explanation for the dump file (this is mandatory!) | 125 // Get an explanation for the dump file (this is mandatory!) |
| 126 var userComments = this.getNonEmptyUserComments_(); | 126 var userComments = this.getNonEmptyUserComments_(); |
| 127 if (userComments == undefined) { | 127 if (userComments == undefined) { |
| 128 return; | 128 return; |
| 129 } | 129 } |
| 130 | 130 |
| 131 this.setSaveFileStatus('Preparing data...', true); | 131 this.setSaveFileStatus('Preparing data...', true); |
| 132 | 132 |
| 133 var securityStripping = g_browser.sourceTracker.getSecurityStripping(); | 133 var securityStripping = |
| 134 SourceTracker.getInstance().getSecurityStripping(); |
| 134 | 135 |
| 135 // If we have a cached log dump, update it synchronously. | 136 // If we have a cached log dump, update it synchronously. |
| 136 if (this.loadedLogDump_) { | 137 if (this.loadedLogDump_) { |
| 137 var dumpText = log_util.createUpdatedLogDump(userComments, | 138 var dumpText = log_util.createUpdatedLogDump(userComments, |
| 138 this.loadedLogDump_, | 139 this.loadedLogDump_, |
| 139 securityStripping); | 140 securityStripping); |
| 140 callback(dumpText); | 141 callback(dumpText); |
| 141 return; | 142 return; |
| 142 } | 143 } |
| 143 | 144 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 blobBuilder.append(dumpText, 'native'); | 186 blobBuilder.append(dumpText, 'native'); |
| 186 var textBlob = blobBuilder.getBlob('octet/stream'); | 187 var textBlob = blobBuilder.getBlob('octet/stream'); |
| 187 this.lastBlobURL_ = window.webkitURL.createObjectURL(textBlob); | 188 this.lastBlobURL_ = window.webkitURL.createObjectURL(textBlob); |
| 188 this.downloadIframe_.src = this.lastBlobURL_; | 189 this.downloadIframe_.src = this.lastBlobURL_; |
| 189 this.setSaveFileStatus('Dump successful', false); | 190 this.setSaveFileStatus('Dump successful', false); |
| 190 } | 191 } |
| 191 }; | 192 }; |
| 192 | 193 |
| 193 return ExportView; | 194 return ExportView; |
| 194 })(); | 195 })(); |
| OLD | NEW |