OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 * | 6 * |
7 * @fileoverview Displays the traced data in raw format. Its primarily | 7 * @fileoverview Displays the traced data in raw format. Its primarily |
8 * usefulness is to allow users to copy-paste their data in an easy to | 8 * usefulness is to allow users to copy-paste their data in an easy to |
9 * read format for bug reports. | 9 * read format for bug reports. |
10 * | 10 * |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 * Updates the view based on its currently known data | 43 * Updates the view based on its currently known data |
44 */ | 44 */ |
45 refresh: function() { | 45 refresh: function() { |
46 if (this.parentNode.selectedTab != this) { | 46 if (this.parentNode.selectedTab != this) { |
47 this.needsRefreshOnShow_ = true; | 47 this.needsRefreshOnShow_ = true; |
48 } | 48 } |
49 | 49 |
50 var dataElement = this.querySelector('.raw-events-view-data'); | 50 var dataElement = this.querySelector('.raw-events-view-data'); |
51 if (tracingController.isTracingEnabled) { | 51 if (tracingController.isTracingEnabled) { |
52 var tmp = 'Still tracing. ' + | 52 var tmp = 'Still tracing. ' + |
53 'Uncheck the enable tracing button to see traced data.'; | 53 'Uncheck the enable tracing button to see traced data.'; |
54 dataElement.textContent = tmp; | 54 dataElement.textContent = tmp; |
55 } else if (!tracingController.traceEvents.length) { | 55 } else if (!tracingController.traceEvents.length) { |
56 dataElement.textContent = | 56 dataElement.textContent = |
57 'No trace data collected. Collect data first.'; | 57 'No trace data collected. Collect data first.'; |
58 } else { | 58 } else { |
59 var events = tracingController.traceEvents; | 59 var events = tracingController.traceEvents; |
60 var text = JSON.stringify(events); | 60 var text = JSON.stringify(events); |
61 dataElement.textContent = text; | 61 dataElement.textContent = text; |
62 | 62 |
63 var selection = window.getSelection(); | 63 var selection = window.getSelection(); |
64 selection.removeAllRanges(); | 64 selection.removeAllRanges(); |
65 var range = document.createRange(); | 65 var range = document.createRange(); |
66 range.selectNodeContents(dataElement); | 66 range.selectNodeContents(dataElement); |
67 selection.addRange(range); | 67 selection.addRange(range); |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
71 }; | 71 }; |
72 | 72 |
73 return { | 73 return { |
74 RawEventsView: RawEventsView | 74 RawEventsView: RawEventsView |
75 }; | 75 }; |
76 }); | 76 }); |
OLD | NEW |