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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js

Issue 2356423002: [DevTools] Turn WebInspector.Panel into a web component.
Patch Set: partial fixes Created 4 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 22 matching lines...) Expand all
33 * @constructor 33 * @constructor
34 * @extends {WebInspector.Panel} 34 * @extends {WebInspector.Panel}
35 * @implements {WebInspector.TimelineLifecycleDelegate} 35 * @implements {WebInspector.TimelineLifecycleDelegate}
36 * @implements {WebInspector.TimelineModeViewDelegate} 36 * @implements {WebInspector.TimelineModeViewDelegate}
37 * @implements {WebInspector.Searchable} 37 * @implements {WebInspector.Searchable}
38 */ 38 */
39 WebInspector.TimelinePanel = function() 39 WebInspector.TimelinePanel = function()
40 { 40 {
41 WebInspector.Panel.call(this, "timeline"); 41 WebInspector.Panel.call(this, "timeline");
42 this.registerRequiredCSS("timeline/timelinePanel.css"); 42 this.registerRequiredCSS("timeline/timelinePanel.css");
43 this.element.addEventListener("contextmenu", this._contextMenu.bind(this), f alse); 43 this.contentElement.addEventListener("contextmenu", this._contextMenu.bind(t his), false);
44 this._dropTarget = new WebInspector.DropTarget(this.element, [WebInspector.D ropTarget.Types.Files, WebInspector.DropTarget.Types.URIList], WebInspector.UISt ring("Drop timeline file or URL here"), this._handleDrop.bind(this)); 44 this._dropTarget = new WebInspector.DropTarget(this.contentElement, [WebInsp ector.DropTarget.Types.Files, WebInspector.DropTarget.Types.URIList], WebInspect or.UIString("Drop timeline file or URL here"), this._handleDrop.bind(this));
45 45
46 this._state = WebInspector.TimelinePanel.State.Idle; 46 this._state = WebInspector.TimelinePanel.State.Idle;
47 this._detailsLinkifier = new WebInspector.Linkifier(); 47 this._detailsLinkifier = new WebInspector.Linkifier();
48 this._windowStartTime = 0; 48 this._windowStartTime = 0;
49 this._windowEndTime = Infinity; 49 this._windowEndTime = Infinity;
50 this._millisecondsToRecordAfterLoadEvent = 3000; 50 this._millisecondsToRecordAfterLoadEvent = 3000;
51 this._toggleRecordAction = /** @type {!WebInspector.Action }*/ (WebInspector .actionRegistry.action("timeline.toggle-recording")); 51 this._toggleRecordAction = /** @type {!WebInspector.Action }*/ (WebInspector .actionRegistry.action("timeline.toggle-recording"));
52 this._customCPUThrottlingRate = 0; 52 this._customCPUThrottlingRate = 0;
53 53
54 /** @type {!Array<!WebInspector.TimelineModel.Filter>} */ 54 /** @type {!Array<!WebInspector.TimelineModel.Filter>} */
(...skipping 15 matching lines...) Expand all
70 70
71 /** @type {!Array.<!WebInspector.TimelineModeView>} */ 71 /** @type {!Array.<!WebInspector.TimelineModeView>} */
72 this._currentViews = []; 72 this._currentViews = [];
73 73
74 this._captureNetworkSetting = WebInspector.settings.createSetting("timelineC aptureNetwork", false); 74 this._captureNetworkSetting = WebInspector.settings.createSetting("timelineC aptureNetwork", false);
75 this._captureJSProfileSetting = WebInspector.settings.createSetting("timelin eEnableJSSampling", true); 75 this._captureJSProfileSetting = WebInspector.settings.createSetting("timelin eEnableJSSampling", true);
76 this._captureMemorySetting = WebInspector.settings.createSetting("timelineCa ptureMemory", false); 76 this._captureMemorySetting = WebInspector.settings.createSetting("timelineCa ptureMemory", false);
77 this._captureLayersAndPicturesSetting = WebInspector.settings.createSetting( "timelineCaptureLayersAndPictures", false); 77 this._captureLayersAndPicturesSetting = WebInspector.settings.createSetting( "timelineCaptureLayersAndPictures", false);
78 this._captureFilmStripSetting = WebInspector.settings.createSetting("timelin eCaptureFilmStrip", false); 78 this._captureFilmStripSetting = WebInspector.settings.createSetting("timelin eCaptureFilmStrip", false);
79 79
80 this._panelToolbar = new WebInspector.Toolbar("", this.element); 80 this._panelToolbar = new WebInspector.Toolbar("", this.contentElement);
81 this._createToolbarItems(); 81 this._createToolbarItems();
82 82
83 var timelinePane = new WebInspector.VBox(); 83 var timelinePane = new WebInspector.VBox();
84 timelinePane.show(this.element); 84 timelinePane.show(this.contentElement);
85 var topPaneElement = timelinePane.element.createChild("div", "hbox"); 85 var topPaneElement = timelinePane.element.createChild("div", "hbox");
86 topPaneElement.id = "timeline-overview-panel"; 86 topPaneElement.id = "timeline-overview-panel";
87 87
88 // Create top overview component. 88 // Create top overview component.
89 this._overviewPane = new WebInspector.TimelineOverviewPane("timeline"); 89 this._overviewPane = new WebInspector.TimelineOverviewPane("timeline");
90 this._overviewPane.addEventListener(WebInspector.TimelineOverviewPane.Events .WindowChanged, this._onWindowChanged.bind(this)); 90 this._overviewPane.addEventListener(WebInspector.TimelineOverviewPane.Events .WindowChanged, this._onWindowChanged.bind(this));
91 this._overviewPane.show(topPaneElement); 91 this._overviewPane.show(topPaneElement);
92 this._statusPaneContainer = timelinePane.element.createChild("div", "status- pane-container fill"); 92 this._statusPaneContainer = timelinePane.element.createChild("div", "status- pane-container fill");
93 93
94 this._createFileSelector(); 94 this._createFileSelector();
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 { 445 {
446 console.assert(this._state === WebInspector.TimelinePanel.State.Idle); 446 console.assert(this._state === WebInspector.TimelinePanel.State.Idle);
447 this._setState(WebInspector.TimelinePanel.State.Loading); 447 this._setState(WebInspector.TimelinePanel.State.Loading);
448 }, 448 },
449 449
450 _createFileSelector: function() 450 _createFileSelector: function()
451 { 451 {
452 if (this._fileSelectorElement) 452 if (this._fileSelectorElement)
453 this._fileSelectorElement.remove(); 453 this._fileSelectorElement.remove();
454 this._fileSelectorElement = WebInspector.createFileSelectorElement(this. _loadFromFile.bind(this)); 454 this._fileSelectorElement = WebInspector.createFileSelectorElement(this. _loadFromFile.bind(this));
455 this.element.appendChild(this._fileSelectorElement); 455 this.contentElement.appendChild(this._fileSelectorElement);
456 }, 456 },
457 457
458 /** 458 /**
459 * @param {!Event} event 459 * @param {!Event} event
460 */ 460 */
461 _contextMenu: function(event) 461 _contextMenu: function(event)
462 { 462 {
463 var contextMenu = new WebInspector.ContextMenu(event); 463 var contextMenu = new WebInspector.ContextMenu(event);
464 contextMenu.appendItemsAtLocation("timelineMenu"); 464 contextMenu.appendItemsAtLocation("timelineMenu");
465 contextMenu.show(); 465 contextMenu.show();
(...skipping 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after
2116 _onKeyDown: function(event) 2116 _onKeyDown: function(event)
2117 { 2117 {
2118 if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code) { 2118 if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Enter.code) {
2119 event.preventDefault(); 2119 event.preventDefault();
2120 this._apply(); 2120 this._apply();
2121 } 2121 }
2122 }, 2122 },
2123 2123
2124 __proto__: WebInspector.HBox.prototype 2124 __proto__: WebInspector.HBox.prototype
2125 } 2125 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698