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

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

Issue 1273363002: Devtools UI: Show multiple shortcuts, show more shortcuts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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) 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 wasShown: function() 148 wasShown: function()
149 { 149 {
150 if (!WebInspector.TimelinePanel._categoryStylesInitialized) { 150 if (!WebInspector.TimelinePanel._categoryStylesInitialized) {
151 WebInspector.TimelinePanel._categoryStylesInitialized = true; 151 WebInspector.TimelinePanel._categoryStylesInitialized = true;
152 var style = createElement("style"); 152 var style = createElement("style");
153 var categories = WebInspector.TimelineUIUtils.categories(); 153 var categories = WebInspector.TimelineUIUtils.categories();
154 style.textContent = Object.values(categories).map(WebInspector.Timel ineUIUtils.createStyleRuleForCategory).join("\n"); 154 style.textContent = Object.values(categories).map(WebInspector.Timel ineUIUtils.createStyleRuleForCategory).join("\n");
155 this.element.ownerDocument.head.appendChild(style); 155 this.element.ownerDocument.head.appendChild(style);
156 } 156 }
157 WebInspector.context.setFlavor(WebInspector.TimelinePanel, this);
158 },
159
160 willHide: function()
161 {
162 WebInspector.context.setFlavor(WebInspector.TimelinePanel, null);
157 }, 163 },
158 164
159 /** 165 /**
160 * @return {number} 166 * @return {number}
161 */ 167 */
162 windowStartTime: function() 168 windowStartTime: function()
163 { 169 {
164 if (this._windowStartTime) 170 if (this._windowStartTime)
165 return this._windowStartTime; 171 return this._windowStartTime;
166 return this._model.minimumRecordTime(); 172 return this._model.minimumRecordTime();
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 this._recordingOptionUIControls = []; 302 this._recordingOptionUIControls = [];
297 var checkboxItem = new WebInspector.ToolbarCheckbox(name, tooltip, setti ng); 303 var checkboxItem = new WebInspector.ToolbarCheckbox(name, tooltip, setti ng);
298 this._recordingOptionUIControls.push(checkboxItem); 304 this._recordingOptionUIControls.push(checkboxItem);
299 return checkboxItem; 305 return checkboxItem;
300 }, 306 },
301 307
302 _createToolbarItems: function() 308 _createToolbarItems: function()
303 { 309 {
304 this._panelToolbar = new WebInspector.Toolbar(this.element); 310 this._panelToolbar = new WebInspector.Toolbar(this.element);
305 311
306 this.toggleTimelineButton = new WebInspector.ToolbarButton("Record timel ine", "record-toolbar-item"); 312 this.toggleTimelineButton = WebInspector.ToolbarButton.createActionButto n("timeline.toggle-recording");
307 this.toggleTimelineButton.addEventListener("click", this._toggleTimeline ButtonClicked, this);
308 this._panelToolbar.appendToolbarItem(this.toggleTimelineButton); 313 this._panelToolbar.appendToolbarItem(this.toggleTimelineButton);
309 this._updateToggleTimelineButton(false); 314 this._updateToggleTimelineButton(false);
310 315
311 var clearButton = new WebInspector.ToolbarButton(WebInspector.UIString(" Clear recording"), "clear-toolbar-item"); 316 var clearButton = new WebInspector.ToolbarButton(WebInspector.UIString(" Clear recording"), "clear-toolbar-item");
312 clearButton.addEventListener("click", this._onClearButtonClick, this); 317 clearButton.addEventListener("click", this._onClearButtonClick, this);
313 this._panelToolbar.appendToolbarItem(clearButton); 318 this._panelToolbar.appendToolbarItem(clearButton);
314 this._panelToolbar.appendSeparator(); 319 this._panelToolbar.appendSeparator();
315 320
316 this._filterBar = this._createFilterBar(); 321 this._filterBar = this._createFilterBar();
317 this._panelToolbar.appendToolbarItem(this._filterBar.filterButton()); 322 this._panelToolbar.appendToolbarItem(this._filterBar.filterButton());
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 this._dropTarget.setEnabled(!this._operationInProgress); 475 this._dropTarget.setEnabled(!this._operationInProgress);
471 476
472 this._progressToolbarItem.setVisible(this._operationInProgress); 477 this._progressToolbarItem.setVisible(this._operationInProgress);
473 this._progressToolbarItem.element.removeChildren(); 478 this._progressToolbarItem.element.removeChildren();
474 if (indicator) 479 if (indicator)
475 this._progressToolbarItem.element.appendChild(indicator.element); 480 this._progressToolbarItem.element.appendChild(indicator.element);
476 }, 481 },
477 482
478 _registerShortcuts: function() 483 _registerShortcuts: function()
479 { 484 {
480 this.registerShortcuts(WebInspector.ShortcutsScreen.TimelinePanelShortcu ts.StartStopRecording, this._toggleTimelineButtonClicked.bind(this));
481 this.registerShortcuts(WebInspector.ShortcutsScreen.TimelinePanelShortcu ts.SaveToFile, this._saveToFile.bind(this)); 485 this.registerShortcuts(WebInspector.ShortcutsScreen.TimelinePanelShortcu ts.SaveToFile, this._saveToFile.bind(this));
482 this.registerShortcuts(WebInspector.ShortcutsScreen.TimelinePanelShortcu ts.LoadFromFile, this._selectFileToLoad.bind(this)); 486 this.registerShortcuts(WebInspector.ShortcutsScreen.TimelinePanelShortcu ts.LoadFromFile, this._selectFileToLoad.bind(this));
483 this.registerShortcuts(WebInspector.ShortcutsScreen.TimelinePanelShortcu ts.JumpToPreviousFrame, this._jumpToFrame.bind(this, -1)); 487 this.registerShortcuts(WebInspector.ShortcutsScreen.TimelinePanelShortcu ts.JumpToPreviousFrame, this._jumpToFrame.bind(this, -1));
484 this.registerShortcuts(WebInspector.ShortcutsScreen.TimelinePanelShortcu ts.JumpToNextFrame, this._jumpToFrame.bind(this, 1)); 488 this.registerShortcuts(WebInspector.ShortcutsScreen.TimelinePanelShortcu ts.JumpToNextFrame, this._jumpToFrame.bind(this, 1));
485 }, 489 },
486 490
487 _createFileSelector: function() 491 _createFileSelector: function()
488 { 492 {
489 if (this._fileSelectorElement) 493 if (this._fileSelectorElement)
490 this._fileSelectorElement.remove(); 494 this._fileSelectorElement.remove();
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 /** 1796 /**
1793 * @override 1797 * @override
1794 * @param {string} value 1798 * @param {string} value
1795 */ 1799 */
1796 handleQueryParam: function(value) 1800 handleQueryParam: function(value)
1797 { 1801 {
1798 WebInspector.TimelinePanel.show(); 1802 WebInspector.TimelinePanel.show();
1799 WebInspector.TimelinePanel.instance()._loadFromURL(value); 1803 WebInspector.TimelinePanel.instance()._loadFromURL(value);
1800 } 1804 }
1801 } 1805 }
1806
1807 /**
1808 * @constructor
1809 * @implements {WebInspector.ActionDelegate}
1810 */
1811 WebInspector.TimelinePanel.RecordActionDelegate = function()
1812 {
1813 }
1814
1815 WebInspector.TimelinePanel.RecordActionDelegate.prototype = {
1816 /**
1817 * @override
1818 * @param {!WebInspector.Context} context
1819 * @param {string} actionId
1820 */
1821 handleAction: function(context, actionId)
1822 {
1823 var panel = WebInspector.context.flavor(WebInspector.TimelinePanel);
1824 if (!panel || !(panel instanceof WebInspector.TimelinePanel))
pfeldman 2015/08/28 16:24:45 When you specify the context, this should become a
samli 2015/08/28 17:21:22 Done.
1825 return;
1826 panel._toggleTimelineButtonClicked();
1827 }
1828 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698