Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1267)

Side by Side Diff: Source/devtools/front_end/TimelineView.js

Issue 180273023: DevTools: encapsulate presentation model in timeline view. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 17 matching lines...) Expand all
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 /** 32 /**
33 * @constructor 33 * @constructor
34 * @extends {WebInspector.View} 34 * @extends {WebInspector.View}
35 * @implements {WebInspector.TimelineModeView} 35 * @implements {WebInspector.TimelineModeView}
36 * @param {!WebInspector.TimelineModeViewDelegate} delegate 36 * @param {!WebInspector.TimelineModeViewDelegate} delegate
37 * @param {!WebInspector.TimelineModel} model 37 * @param {!WebInspector.TimelineModel} model
38 * @param {!WebInspector.TimelinePresentationModel} presentationModel
39 * @param {?WebInspector.TimelineFrameModel} frameModel
40 */ 38 */
41 WebInspector.TimelineView = function(delegate, model, presentationModel, frameMo del) 39 WebInspector.TimelineView = function(delegate, model)
42 { 40 {
43 WebInspector.View.call(this); 41 WebInspector.View.call(this);
44 this.element.classList.add("timeline-view"); 42 this.element.classList.add("timeline-view");
45 this.element.classList.add("hbox"); 43 this.element.classList.add("hbox");
46 44
47 this._delegate = delegate; 45 this._delegate = delegate;
48 this._model = model; 46 this._model = model;
49 this._presentationModel = presentationModel; 47 this._presentationModel = new WebInspector.TimelinePresentationModel(model, delegate);
caseq 2014/03/04 15:47:49 drop delegagte
pfeldman 2014/03/04 16:01:29 Done.
50 this._frameModel = frameModel;
51 this._calculator = new WebInspector.TimelineCalculator(model); 48 this._calculator = new WebInspector.TimelineCalculator(model);
52 this._linkifier = new WebInspector.Linkifier(); 49 this._linkifier = new WebInspector.Linkifier();
53 50
54 this._boundariesAreValid = true; 51 this._boundariesAreValid = true;
55 this._scrollTop = 0; 52 this._scrollTop = 0;
56 53
57 this._recordsView = this._createRecordsView(); 54 this._recordsView = this._createRecordsView();
58 this._recordsView.addEventListener(WebInspector.SplitView.Events.SidebarSize Changed, this._sidebarResized, this); 55 this._recordsView.addEventListener(WebInspector.SplitView.Events.SidebarSize Changed, this._sidebarResized, this);
59 this._recordsView.show(this.element); 56 this._recordsView.show(this.element);
60 this.element.appendChild(this._timelineGrid.gridHeaderElement); 57 this.element.appendChild(this._timelineGrid.gridHeaderElement);
61 58
62 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this._get PopoverAnchor.bind(this), this._showPopover.bind(this)); 59 this._popoverHelper = new WebInspector.PopoverHelper(this.element, this._get PopoverAnchor.bind(this), this._showPopover.bind(this));
63 60
64 this.element.addEventListener("mousemove", this._mouseMove.bind(this), false ); 61 this.element.addEventListener("mousemove", this._mouseMove.bind(this), false );
65 this.element.addEventListener("mouseout", this._mouseOut.bind(this), false); 62 this.element.addEventListener("mouseout", this._mouseOut.bind(this), false);
66 this.element.addEventListener("keydown", this._keyDown.bind(this), false); 63 this.element.addEventListener("keydown", this._keyDown.bind(this), false);
67 64
68 this._expandOffset = 15; 65 this._expandOffset = 15;
69 } 66 }
70 67
71 WebInspector.TimelineView.prototype = { 68 WebInspector.TimelineView.prototype = {
72 /** 69 /**
70 * @param {?WebInspector.TimelineFrameModel} frameModel
71 */
72 setFrameModel: function(frameModel)
73 {
74 this._frameModel = frameModel;
75 },
76
77 /**
73 * @return {!WebInspector.SplitView} 78 * @return {!WebInspector.SplitView}
74 */ 79 */
75 _createRecordsView: function() 80 _createRecordsView: function()
76 { 81 {
77 var recordsView = new WebInspector.SplitView(true, false, "timelinePanel RecorsSplitViewState"); 82 var recordsView = new WebInspector.SplitView(true, false, "timelinePanel RecorsSplitViewState");
78 this._containerElement = recordsView.element; 83 this._containerElement = recordsView.element;
79 this._containerElement.tabIndex = 0; 84 this._containerElement.tabIndex = 0;
80 this._containerElement.id = "timeline-container"; 85 this._containerElement.id = "timeline-container";
81 this._containerElement.addEventListener("scroll", this._onScroll.bind(th is), false); 86 this._containerElement.addEventListener("scroll", this._onScroll.bind(th is), false);
82 87
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 _rootRecord: function() 119 _rootRecord: function()
115 { 120 {
116 return this._presentationModel.rootRecord(); 121 return this._presentationModel.rootRecord();
117 }, 122 },
118 123
119 _updateEventDividers: function() 124 _updateEventDividers: function()
120 { 125 {
121 this._timelineGrid.removeEventDividers(); 126 this._timelineGrid.removeEventDividers();
122 var clientWidth = this._graphRowsElementWidth; 127 var clientWidth = this._graphRowsElementWidth;
123 var dividers = []; 128 var dividers = [];
124 var eventDividerRecords = this._presentationModel.eventDividerRecords(); 129 var eventDividerRecords = this._model.eventDividerRecords();
125 130
126 for (var i = 0; i < eventDividerRecords.length; ++i) { 131 for (var i = 0; i < eventDividerRecords.length; ++i) {
127 var record = eventDividerRecords[i]; 132 var record = eventDividerRecords[i];
128 var positions = this._calculator.computeBarGraphWindowPosition(recor d); 133 var positions = this._calculator.computeBarGraphWindowPosition(recor d);
129 var dividerPosition = Math.round(positions.left); 134 var dividerPosition = Math.round(positions.left);
130 if (dividerPosition < 0 || dividerPosition >= clientWidth || divider s[dividerPosition]) 135 if (dividerPosition < 0 || dividerPosition >= clientWidth || divider s[dividerPosition])
131 continue; 136 continue;
132 var divider = WebInspector.TimelineUIUtils.createEventDivider(record .type, WebInspector.TimelineUIUtils.recordTitle(record)); 137 var divider = WebInspector.TimelineUIUtils.createEventDivider(record .type, WebInspector.TimelineUIUtils.recordTitle(record));
133 divider.style.left = dividerPosition + "px"; 138 divider.style.left = dividerPosition + "px";
134 dividers[dividerPosition] = divider; 139 dividers[dividerPosition] = divider;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 if (!frameBar) 192 if (!frameBar)
188 return; 193 return;
189 this._delegate.requestWindowTimes(frameBar._frame.startTime, frameBar._f rame.endTime); 194 this._delegate.requestWindowTimes(frameBar._frame.startTime, frameBar._f rame.endTime);
190 }, 195 },
191 196
192 /** 197 /**
193 * @param {!WebInspector.TimelineModel.Record} record 198 * @param {!WebInspector.TimelineModel.Record} record
194 */ 199 */
195 addRecord: function(record) 200 addRecord: function(record)
196 { 201 {
197 if (this._innerAddRecordToTimeline(record)) 202 this._presentationModel.addRecord(record);
198 this._invalidateAndScheduleRefresh(false, false); 203 this._invalidateAndScheduleRefresh(false, false);
199 }, 204 },
200 205
201 /** 206 /**
202 * @param {!WebInspector.TimelineModel.Record} record
203 * @return {boolean}
204 */
205 _innerAddRecordToTimeline: function(record)
206 {
207 if (record.type === WebInspector.TimelineModel.RecordType.GPUTask)
208 return record.startTime < this._windowEndTime;
209
210 var hasVisibleRecords = false;
211 var presentationModel = this._presentationModel;
212 function checkVisible(record)
213 {
214 hasVisibleRecords |= presentationModel.isVisible(record);
215 }
216 WebInspector.TimelineModel.forAllRecords([record], checkVisible);
217 return hasVisibleRecords;
218 },
219
220 /**
221 * @param {number} width 207 * @param {number} width
222 */ 208 */
223 setSidebarSize: function(width) 209 setSidebarSize: function(width)
224 { 210 {
225 this._recordsView.setSidebarSize(width); 211 this._recordsView.setSidebarSize(width);
226 }, 212 },
227 213
228 /** 214 /**
229 * @param {!WebInspector.Event} event 215 * @param {!WebInspector.Event} event
230 */ 216 */
(...skipping 22 matching lines...) Expand all
253 239
254 _resetView: function() 240 _resetView: function()
255 { 241 {
256 this._windowStartTime = -1; 242 this._windowStartTime = -1;
257 this._windowEndTime = -1; 243 this._windowEndTime = -1;
258 this._boundariesAreValid = false; 244 this._boundariesAreValid = false;
259 this._adjustScrollPosition(0); 245 this._adjustScrollPosition(0);
260 this._linkifier.reset(); 246 this._linkifier.reset();
261 this._closeRecordDetails(); 247 this._closeRecordDetails();
262 this._automaticallySizeWindow = true; 248 this._automaticallySizeWindow = true;
249 this._presentationModel.reset();
263 }, 250 },
264 251
265 reset: function() 252 reset: function()
266 { 253 {
267 this._resetView(); 254 this._resetView();
268 this._invalidateAndScheduleRefresh(true, true); 255 this._invalidateAndScheduleRefresh(true, true);
269 }, 256 },
270 257
271 /** 258 /**
272 * @return {!Array.<!Element>} 259 * @return {!Array.<!Element>}
273 */ 260 */
274 elementsToRestoreScrollPositionsFor: function() 261 elementsToRestoreScrollPositionsFor: function()
275 { 262 {
276 return [this._containerElement]; 263 return [this._containerElement];
277 }, 264 },
278 265
279 refreshRecords: function() 266 /**
267 * @param {?RegExp} textFilter
268 */
269 refreshRecords: function(textFilter)
280 { 270 {
281 this._automaticallySizeWindow = false; 271 this._automaticallySizeWindow = false;
272 this._presentationModel.setTextFilter(textFilter);
282 this._invalidateAndScheduleRefresh(false, true); 273 this._invalidateAndScheduleRefresh(false, true);
283 }, 274 },
284 275
285 wasShown: function() 276 wasShown: function()
286 { 277 {
287 WebInspector.View.prototype.wasShown.call(this); 278 WebInspector.View.prototype.wasShown.call(this);
288 279
289 if (!WebInspector.TimelinePanel._categoryStylesInitialized) { 280 if (!WebInspector.TimelinePanel._categoryStylesInitialized) {
290 WebInspector.TimelinePanel._categoryStylesInitialized = true; 281 WebInspector.TimelinePanel._categoryStylesInitialized = true;
291 this._injectCategoryStyles(); 282 this._injectCategoryStyles();
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 /** 440 /**
450 * @param {!WebInspector.TimelinePresentationModel.Record} recordToReveal 441 * @param {!WebInspector.TimelinePresentationModel.Record} recordToReveal
451 */ 442 */
452 _innerRevealRecord: function(recordToReveal) 443 _innerRevealRecord: function(recordToReveal)
453 { 444 {
454 var needRefresh = false; 445 var needRefresh = false;
455 // Expand all ancestors. 446 // Expand all ancestors.
456 for (var parent = recordToReveal.presentationParent(); parent !== this._ rootRecord(); parent = parent.presentationParent()) { 447 for (var parent = recordToReveal.presentationParent(); parent !== this._ rootRecord(); parent = parent.presentationParent()) {
457 if (!parent.collapsed()) 448 if (!parent.collapsed())
458 continue; 449 continue;
459 this._presentationModel.invalidateFilteredRecords();
caseq 2014/03/04 15:47:49 Why is this gone?
pfeldman 2014/03/04 16:01:29 Done.
460 parent.setCollapsed(false); 450 parent.setCollapsed(false);
461 needRefresh = true; 451 needRefresh = true;
462 } 452 }
463 var recordsInWindow = this._presentationModel.filteredRecords(); 453 var recordsInWindow = this._presentationModel.filteredRecords();
464 var index = recordsInWindow.indexOf(recordToReveal); 454 var index = recordsInWindow.indexOf(recordToReveal);
465 455
466 var itemOffset = index * WebInspector.TimelinePanel.rowHeight; 456 var itemOffset = index * WebInspector.TimelinePanel.rowHeight;
467 var visibleTop = this._scrollTop - WebInspector.TimelinePanel.headerHeig ht; 457 var visibleTop = this._scrollTop - WebInspector.TimelinePanel.headerHeig ht;
468 var visibleBottom = visibleTop + this._containerElementHeight - WebInspe ctor.TimelinePanel.rowHeight; 458 var visibleBottom = visibleTop + this._containerElementHeight - WebInspe ctor.TimelinePanel.rowHeight;
469 if (itemOffset < visibleTop) 459 if (itemOffset < visibleTop)
(...skipping 16 matching lines...) Expand all
486 var headerHeight = WebInspector.TimelinePanel.headerHeight; 476 var headerHeight = WebInspector.TimelinePanel.headerHeight;
487 477
488 // Convert visible area to visible indexes. Always include top-level rec ord for a visible nested record. 478 // Convert visible area to visible indexes. Always include top-level rec ord for a visible nested record.
489 var startIndex = Math.max(0, Math.min(Math.floor((visibleTop - headerHei ght) / rowHeight), recordsInWindow.length - 1)); 479 var startIndex = Math.max(0, Math.min(Math.floor((visibleTop - headerHei ght) / rowHeight), recordsInWindow.length - 1));
490 var endIndex = Math.min(recordsInWindow.length, Math.ceil(visibleBottom / rowHeight)); 480 var endIndex = Math.min(recordsInWindow.length, Math.ceil(visibleBottom / rowHeight));
491 var lastVisibleLine = Math.max(0, Math.floor((visibleBottom - headerHeig ht) / rowHeight)); 481 var lastVisibleLine = Math.max(0, Math.floor((visibleBottom - headerHeig ht) / rowHeight));
492 if (this._automaticallySizeWindow && recordsInWindow.length > lastVisibl eLine) { 482 if (this._automaticallySizeWindow && recordsInWindow.length > lastVisibl eLine) {
493 this._automaticallySizeWindow = false; 483 this._automaticallySizeWindow = false;
494 this._selectRecord(null); 484 this._selectRecord(null);
495 // If we're at the top, always use real timeline start as a left win dow bound so that expansion arrow padding logic works. 485 // If we're at the top, always use real timeline start as a left win dow bound so that expansion arrow padding logic works.
496 var windowStartTime = startIndex ? recordsInWindow[startIndex].recor d().startTime : this._presentationModel.minimumRecordTime(); 486 var windowStartTime = startIndex ? recordsInWindow[startIndex].recor d().startTime : this._model.minimumRecordTime();
497 var windowEndTime = recordsInWindow[Math.max(0, lastVisibleLine - 1) ].record().endTime; 487 var windowEndTime = recordsInWindow[Math.max(0, lastVisibleLine - 1) ].record().endTime;
498 this._delegate.requestWindowTimes(windowStartTime, windowEndTime); 488 this._delegate.requestWindowTimes(windowStartTime, windowEndTime);
499 recordsInWindow = this._presentationModel.filteredRecords(); 489 recordsInWindow = this._presentationModel.filteredRecords();
500 endIndex = Math.min(recordsInWindow.length, lastVisibleLine); 490 endIndex = Math.min(recordsInWindow.length, lastVisibleLine);
501 } 491 }
502 492
503 // Resize gaps first. 493 // Resize gaps first.
504 this._topGapElement.style.height = (startIndex * rowHeight) + "px"; 494 this._topGapElement.style.height = (startIndex * rowHeight) + "px";
505 this._recordsView.sidebarElement().firstElementChild.style.flexBasis = ( startIndex * rowHeight + headerHeight) + "px"; 495 this._recordsView.sidebarElement().firstElementChild.style.flexBasis = ( startIndex * rowHeight + headerHeight) + "px";
506 this._bottomGapElement.style.height = (recordsInWindow.length - endIndex ) * rowHeight + "px"; 496 this._bottomGapElement.style.height = (recordsInWindow.length - endIndex ) * rowHeight + "px";
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 557
568 this._itemsGraphsElement.insertBefore(this._graphRowsElement, this._bott omGapElement); 558 this._itemsGraphsElement.insertBefore(this._graphRowsElement, this._bott omGapElement);
569 this._itemsGraphsElement.appendChild(this._expandElements); 559 this._itemsGraphsElement.appendChild(this._expandElements);
570 this._adjustScrollPosition(recordsInWindow.length * rowHeight + headerHe ight); 560 this._adjustScrollPosition(recordsInWindow.length * rowHeight + headerHe ight);
571 561
572 return recordsInWindow.length; 562 return recordsInWindow.length;
573 }, 563 },
574 564
575 _refreshAllUtilizationBars: function() 565 _refreshAllUtilizationBars: function()
576 { 566 {
577 this._refreshUtilizationBars(WebInspector.UIString("CPU"), this._present ationModel.mainThreadTasks(), this._cpuBarsElement); 567 this._refreshUtilizationBars(WebInspector.UIString("CPU"), this._model.m ainThreadTasks(), this._cpuBarsElement);
578 if (WebInspector.experimentsSettings.gpuTimeline.isEnabled()) 568 if (WebInspector.experimentsSettings.gpuTimeline.isEnabled())
579 this._refreshUtilizationBars(WebInspector.UIString("GPU"), this._pre sentationModel.gpuThreadTasks(), this._gpuBarsElement); 569 this._refreshUtilizationBars(WebInspector.UIString("GPU"), this._mod el.gpuThreadTasks(), this._gpuBarsElement);
580 }, 570 },
581 571
582 /** 572 /**
583 * @param {string} name 573 * @param {string} name
584 * @param {!Array.<!WebInspector.TimelineModel.Record>} tasks 574 * @param {!Array.<!WebInspector.TimelineModel.Record>} tasks
585 * @param {?Element} container 575 * @param {?Element} container
586 */ 576 */
587 _refreshUtilizationBars: function(name, tasks, container) 577 _refreshUtilizationBars: function(name, tasks, container)
588 { 578 {
589 if (!container) 579 if (!container)
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 var index = recordsInWindow.indexOf(record); 704 var index = recordsInWindow.indexOf(record);
715 var recordsInPage = Math.floor(this._containerElementHeight / WebInspect or.TimelinePanel.rowHeight); 705 var recordsInPage = Math.floor(this._containerElementHeight / WebInspect or.TimelinePanel.rowHeight);
716 var rowHeight = WebInspector.TimelinePanel.rowHeight; 706 var rowHeight = WebInspector.TimelinePanel.rowHeight;
717 707
718 if (index === -1) 708 if (index === -1)
719 index = 0; 709 index = 0;
720 710
721 switch (event.keyIdentifier) { 711 switch (event.keyIdentifier) {
722 case "Left": 712 case "Left":
723 if (record.presentationParent()) { 713 if (record.presentationParent()) {
724 if ((!record.expandable() || record.collapsed()) && record.prese ntationParent() !== this._presentationModel.rootRecord()) { 714 if ((!record.hasPresentationChildren() || record.collapsed()) && record.presentationParent() !== this._presentationModel.rootRecord()) {
caseq 2014/03/04 15:47:49 This seems to be different from the old logic.
pfeldman 2014/03/04 16:01:29 Done.
725 this._selectRecord(record.presentationParent()); 715 this._selectRecord(record.presentationParent());
726 } else { 716 } else {
727 record.setCollapsed(true); 717 record.setCollapsed(true);
728 record.clicked = true;
729 this._invalidateAndScheduleRefresh(true, true); 718 this._invalidateAndScheduleRefresh(true, true);
730 } 719 }
731 } 720 }
732 event.consume(true); 721 event.consume(true);
733 break; 722 break;
734 case "Up": 723 case "Up":
735 if (--index < 0) 724 if (--index < 0)
736 break; 725 break;
737 this._selectRecord(recordsInWindow[index]); 726 this._selectRecord(recordsInWindow[index]);
738 event.consume(true); 727 event.consume(true);
739 break; 728 break;
740 case "Right": 729 case "Right":
741 if (record.expandable() && record.collapsed()) { 730 if (record.hasPresentationChildren() && record.collapsed()) {
caseq 2014/03/04 15:47:49 ditto
pfeldman 2014/03/04 16:01:29 Done.
742 record.setCollapsed(false); 731 record.setCollapsed(false);
743 record.clicked = true;
744 this._invalidateAndScheduleRefresh(true, true); 732 this._invalidateAndScheduleRefresh(true, true);
745 } else { 733 } else {
746 if (++index >= recordsInWindow.length) 734 if (++index >= recordsInWindow.length)
747 break; 735 break;
748 this._selectRecord(recordsInWindow[index]); 736 this._selectRecord(recordsInWindow[index]);
749 } 737 }
750 event.consume(true); 738 event.consume(true);
751 break; 739 break;
752 case "Down": 740 case "Down":
753 if (++index >= recordsInWindow.length) 741 if (++index >= recordsInWindow.length)
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 } else { 1035 } else {
1048 var detailsNode = WebInspector.TimelineUIUtils.buildDetailsNode(reco rd, this._linkifier); 1036 var detailsNode = WebInspector.TimelineUIUtils.buildDetailsNode(reco rd, this._linkifier);
1049 if (detailsNode) { 1037 if (detailsNode) {
1050 this._dataElement.appendChild(document.createTextNode("(")); 1038 this._dataElement.appendChild(document.createTextNode("("));
1051 this._dataElement.appendChild(detailsNode); 1039 this._dataElement.appendChild(detailsNode);
1052 this._dataElement.appendChild(document.createTextNode(")")); 1040 this._dataElement.appendChild(document.createTextNode(")"));
1053 } 1041 }
1054 } 1042 }
1055 1043
1056 this._expandArrowElement.enableStyleClass("parent", presentationRecord.h asPresentationChildren()); 1044 this._expandArrowElement.enableStyleClass("parent", presentationRecord.h asPresentationChildren());
1057 this._expandArrowElement.enableStyleClass("expanded", presentationRecord .visibleChildrenCount()); 1045 this._expandArrowElement.enableStyleClass("expanded", !!presentationReco rd.visibleChildrenCount());
1058 this._record.setListRow(this); 1046 this._record.setListRow(this);
1059 }, 1047 },
1060 1048
1061 highlight: function(regExp, domChanges) 1049 highlight: function(regExp, domChanges)
1062 { 1050 {
1063 var matchInfo = this.element.textContent.match(regExp); 1051 var matchInfo = this.element.textContent.match(regExp);
1064 if (matchInfo) 1052 if (matchInfo)
1065 WebInspector.highlightSearchResult(this.element, matchInfo.index, ma tchInfo[0].length, domChanges); 1053 WebInspector.highlightSearchResult(this.element, matchInfo.index, ma tchInfo[0].length, domChanges);
1066 }, 1054 },
1067 1055
1068 dispose: function() 1056 dispose: function()
1069 { 1057 {
1070 this.element.remove(); 1058 this.element.remove();
1071 }, 1059 },
1072 1060
1073 /** 1061 /**
1074 * @param {!Event} event 1062 * @param {!Event} event
1075 */ 1063 */
1076 _onExpandClick: function(event) 1064 _onExpandClick: function(event)
1077 { 1065 {
1078 this._record.setCollapsed(!this._record.collapsed()); 1066 this._record.setCollapsed(!this._record.collapsed());
1079 this._record.clicked = true;
1080 this._scheduleRefresh(); 1067 this._scheduleRefresh();
1081 event.consume(true); 1068 event.consume(true);
1082 }, 1069 },
1083 1070
1084 /** 1071 /**
1085 * @param {?Event} event 1072 * @param {?Event} event
1086 */ 1073 */
1087 _onClick: function(event) 1074 _onClick: function(event)
1088 { 1075 {
1089 this._selectRecord(this._record); 1076 this._selectRecord(this._record);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 * @param {boolean} selected 1184 * @param {boolean} selected
1198 */ 1185 */
1199 renderAsSelected: function(selected) 1186 renderAsSelected: function(selected)
1200 { 1187 {
1201 this.element.enableStyleClass("selected", selected); 1188 this.element.enableStyleClass("selected", selected);
1202 }, 1189 },
1203 1190
1204 _expand: function() 1191 _expand: function()
1205 { 1192 {
1206 this._record.setCollapsed(!this._record.collapsed()); 1193 this._record.setCollapsed(!this._record.collapsed());
1207 this._record.clicked = true;
1208 this._scheduleRefresh(); 1194 this._scheduleRefresh();
1209 }, 1195 },
1210 1196
1211 /** 1197 /**
1212 * @param {?Event} event 1198 * @param {?Event} event
1213 */ 1199 */
1214 _onMouseOver: function(event) 1200 _onMouseOver: function(event)
1215 { 1201 {
1216 this.element.classList.add("hovered"); 1202 this.element.classList.add("hovered");
1217 if (this._record.listRow()) 1203 if (this._record.listRow())
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 this._element.classList.remove("hidden"); 1254 this._element.classList.remove("hidden");
1269 } else 1255 } else
1270 this._element.classList.add("hidden"); 1256 this._element.classList.add("hidden");
1271 }, 1257 },
1272 1258
1273 _dispose: function() 1259 _dispose: function()
1274 { 1260 {
1275 this._element.remove(); 1261 this._element.remove();
1276 } 1262 }
1277 } 1263 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698