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

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

Issue 344443007: Encapsulate implementation-specific timeline record handling in TimelineUIUtils (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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.HBox} 34 * @extends {WebInspector.HBox}
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 {!Object.<string, number>} coalescableRecordTypes 38 * @param {!WebInspector.TimelineUIUtils} uiUtils
39 */ 39 */
40 WebInspector.TimelineView = function(delegate, model, coalescableRecordTypes) 40 WebInspector.TimelineView = function(delegate, model, uiUtils)
41 { 41 {
42 WebInspector.HBox.call(this); 42 WebInspector.HBox.call(this);
43 this._uiUtils = uiUtils;
43 this.element.classList.add("timeline-view"); 44 this.element.classList.add("timeline-view");
44 45
45 this._delegate = delegate; 46 this._delegate = delegate;
46 this._model = model; 47 this._model = model;
47 this._presentationModel = new WebInspector.TimelinePresentationModel(model, coalescableRecordTypes); 48 this._presentationModel = new WebInspector.TimelinePresentationModel(model, uiUtils);
48 this._calculator = new WebInspector.TimelineCalculator(model); 49 this._calculator = new WebInspector.TimelineCalculator(model);
49 this._linkifier = new WebInspector.Linkifier(); 50 this._linkifier = new WebInspector.Linkifier();
50 this._frameStripByFrame = new Map(); 51 this._frameStripByFrame = new Map();
51 52
52 this._boundariesAreValid = true; 53 this._boundariesAreValid = true;
53 this._scrollTop = 0; 54 this._scrollTop = 0;
54 55
55 this._recordsView = this._createRecordsView(); 56 this._recordsView = this._createRecordsView();
56 this._recordsView.addEventListener(WebInspector.SplitView.Events.SidebarSize Changed, this._sidebarResized, this); 57 this._recordsView.addEventListener(WebInspector.SplitView.Events.SidebarSize Changed, this._sidebarResized, this);
57 this._recordsView.show(this.element); 58 this._recordsView.show(this.element);
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 if (!rowElement || !rowElement.row) 827 if (!rowElement || !rowElement.row)
827 return false; 828 return false;
828 var presentationRecord = rowElement.row._record; 829 var presentationRecord = rowElement.row._record;
829 if (presentationRecord.coalesced()) 830 if (presentationRecord.coalesced())
830 return false; 831 return false;
831 var record = presentationRecord.record(); 832 var record = presentationRecord.record();
832 if (this._highlightedQuadRecord === record) 833 if (this._highlightedQuadRecord === record)
833 return true; 834 return true;
834 this._highlightedQuadRecord = record; 835 this._highlightedQuadRecord = record;
835 836
836 var quad = record.highlightQuad(); 837 var quad = this._uiUtils.highlightQuadForRecord(record);
837 if (!quad) 838 if (!quad)
838 return false; 839 return false;
839 record.target().domAgent().highlightQuad(quad, WebInspector.Color.PageHi ghlight.Content.toProtocolRGBA(), WebInspector.Color.PageHighlight.ContentOutlin e.toProtocolRGBA()); 840 record.target().domAgent().highlightQuad(quad, WebInspector.Color.PageHi ghlight.Content.toProtocolRGBA(), WebInspector.Color.PageHighlight.ContentOutlin e.toProtocolRGBA());
840 return true; 841 return true;
841 }, 842 },
842 843
843 _hideQuadHighlight: function() 844 _hideQuadHighlight: function()
844 { 845 {
845 if (this._highlightedQuadRecord) { 846 if (this._highlightedQuadRecord) {
846 this._highlightedQuadRecord.target().domAgent().hideHighlight(); 847 this._highlightedQuadRecord.target().domAgent().hideHighlight();
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1294 this._element.classList.remove("hidden"); 1295 this._element.classList.remove("hidden");
1295 } else 1296 } else
1296 this._element.classList.add("hidden"); 1297 this._element.classList.add("hidden");
1297 }, 1298 },
1298 1299
1299 _dispose: function() 1300 _dispose: function()
1300 { 1301 {
1301 this._element.remove(); 1302 this._element.remove();
1302 } 1303 }
1303 } 1304 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineUIUtilsImpl.js ('k') | Source/devtools/front_end/timeline/TracingTimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698