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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 createLogDump_: function(callback) { | 131 createLogDump_: function(callback) { |
132 // Get an explanation for the dump file (this is mandatory!) | 132 // Get an explanation for the dump file (this is mandatory!) |
133 var userComments = this.userCommentsTextArea_.value; | 133 var userComments = this.userCommentsTextArea_.value; |
134 | 134 |
135 this.setSaveFileStatus('Preparing data...', true); | 135 this.setSaveFileStatus('Preparing data...', true); |
136 | 136 |
137 var privacyStripping = SourceTracker.getInstance().getPrivacyStripping(); | 137 var privacyStripping = SourceTracker.getInstance().getPrivacyStripping(); |
138 | 138 |
139 // If we have a cached log dump, update it synchronously. | 139 // If we have a cached log dump, update it synchronously. |
140 if (this.loadedLogDump_) { | 140 if (this.loadedLogDump_) { |
141 var dumpText = log_util.createUpdatedLogDump(userComments, | 141 var dumpText = log_util.createUpdatedLogDump( |
142 this.loadedLogDump_, | 142 userComments, this.loadedLogDump_, privacyStripping); |
143 privacyStripping); | |
144 callback(dumpText); | 143 callback(dumpText); |
145 return; | 144 return; |
146 } | 145 } |
147 | 146 |
148 // Otherwise, poll information from the browser before creating one. | 147 // Otherwise, poll information from the browser before creating one. |
149 log_util.createLogDumpAsync(userComments, | 148 log_util.createLogDumpAsync(userComments, callback, privacyStripping); |
150 callback, | |
151 privacyStripping); | |
152 }, | 149 }, |
153 | 150 |
154 /** | 151 /** |
155 * Sets the user comments. | 152 * Sets the user comments. |
156 */ | 153 */ |
157 setUserComments_: function(userComments) { | 154 setUserComments_: function(userComments) { |
158 this.userCommentsTextArea_.value = userComments; | 155 this.userCommentsTextArea_.value = userComments; |
159 this.onUserCommentsUpdated_(); | 156 this.onUserCommentsUpdated_(); |
160 }, | 157 }, |
161 | 158 |
(...skipping 16 matching lines...) Expand all Loading... |
178 var downloadAnchor = $(ExportView.DOWNLOAD_ANCHOR_ID); | 175 var downloadAnchor = $(ExportView.DOWNLOAD_ANCHOR_ID); |
179 downloadAnchor.href = this.lastBlobURL_; | 176 downloadAnchor.href = this.lastBlobURL_; |
180 downloadAnchor.click(); | 177 downloadAnchor.click(); |
181 | 178 |
182 this.setSaveFileStatus('Dump successful', false); | 179 this.setSaveFileStatus('Dump successful', false); |
183 } | 180 } |
184 }; | 181 }; |
185 | 182 |
186 return ExportView; | 183 return ExportView; |
187 })(); | 184 })(); |
OLD | NEW |