Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 * @fileoverview | 6 * @fileoverview |
| 7 * 'settings-reset-profile-dialog' is the dialog shown for clearing profile | 7 * 'settings-reset-profile-dialog' is the dialog shown for clearing profile |
| 8 * settings. | 8 * settings. |
| 9 */ | 9 */ |
| 10 Polymer({ | 10 Polymer({ |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 this.dispatchEvent(new CustomEvent('reset-done')); | 44 this.dispatchEvent(new CustomEvent('reset-done')); |
| 45 }.bind(this)); | 45 }.bind(this)); |
| 46 }, | 46 }, |
| 47 | 47 |
| 48 /** | 48 /** |
| 49 * Displays the settings that will be reported in a new tab. | 49 * Displays the settings that will be reported in a new tab. |
| 50 * @private | 50 * @private |
| 51 */ | 51 */ |
| 52 onShowReportedSettingsTap_: function() { | 52 onShowReportedSettingsTap_: function() { |
| 53 this.browserProxy_.getReportedSettings().then(function(settings) { | 53 this.browserProxy_.getReportedSettings().then(function(settings) { |
| 54 var feedbackObj = {}; | 54 var output = settings.map(function(entry) { |
| 55 settings.forEach(function(entry) { | 55 return entry.key + ': ' + entry.value.replace(/\n/g, ', '); |
|
dschuyler
2016/04/23 00:57:34
Could the line endings contain \r as well (e.g. on
dpapad
2016/04/23 01:18:13
This data comes from https://code.google.com/p/chr
| |
| 56 // Break strings with '\n' characters into arrays to make the settings a | |
| 57 // bit more readable. | |
| 58 var values = entry.value.split('\n'); | |
| 59 feedbackObj[entry.key] = values.length == 1 ? values[0] : values; | |
| 60 }); | 56 }); |
| 61 var win = window.open('about:blank'); | 57 var win = window.open('about:blank'); |
| 62 var div = win.document.createElement('div'); | 58 var div = win.document.createElement('div'); |
| 63 div.textContent = JSON.stringify(feedbackObj, null, 2 /* spaces */); | 59 div.textContent = output.join('\n'); |
| 64 div.style.whiteSpace = 'pre'; | 60 div.style.whiteSpace = 'pre'; |
| 65 win.document.body.appendChild(div); | 61 win.document.body.appendChild(div); |
| 66 }); | 62 }); |
| 67 }, | 63 }, |
| 68 }); | 64 }); |
| OLD | NEW |