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

Side by Side Diff: Source/devtools/front_end/profiler/CanvasReplayStateView.js

Issue 720223002: DevTools: only allow status bar items in status bars. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 22 matching lines...) Expand all
33 * @extends {WebInspector.VBox} 33 * @extends {WebInspector.VBox}
34 * @param {!WebInspector.CanvasTraceLogPlayerProxy} traceLogPlayer 34 * @param {!WebInspector.CanvasTraceLogPlayerProxy} traceLogPlayer
35 */ 35 */
36 WebInspector.CanvasReplayStateView = function(traceLogPlayer) 36 WebInspector.CanvasReplayStateView = function(traceLogPlayer)
37 { 37 {
38 WebInspector.VBox.call(this); 38 WebInspector.VBox.call(this);
39 this.registerRequiredCSS("profiler/canvasProfiler.css"); 39 this.registerRequiredCSS("profiler/canvasProfiler.css");
40 this.element.classList.add("canvas-replay-state-view"); 40 this.element.classList.add("canvas-replay-state-view");
41 this._traceLogPlayer = traceLogPlayer; 41 this._traceLogPlayer = traceLogPlayer;
42 42
43 var controlsContainer = this.element.createChild("div", "status-bar"); 43 var controlsToolbar = new WebInspector.StatusBar(this.element);
44 this._prevButton = this._createControlButton(controlsContainer, "canvas-repl ay-state-prev", WebInspector.UIString("Previous resource."), this._onResourceNav igationClick.bind(this, false)); 44 this._prevButton = this._createControlButton(controlsToolbar, "canvas-replay -state-prev", WebInspector.UIString("Previous resource."), this._onResourceNavig ationClick.bind(this, false));
45 this._nextButton = this._createControlButton(controlsContainer, "canvas-repl ay-state-next", WebInspector.UIString("Next resource."), this._onResourceNavigat ionClick.bind(this, true)); 45 this._nextButton = this._createControlButton(controlsToolbar, "canvas-replay -state-next", WebInspector.UIString("Next resource."), this._onResourceNavigatio nClick.bind(this, true));
46 this._createControlButton(controlsContainer, "canvas-replay-state-refresh", WebInspector.UIString("Refresh."), this._onStateRefreshClick.bind(this)); 46 this._createControlButton(controlsToolbar, "canvas-replay-state-refresh", We bInspector.UIString("Refresh."), this._onStateRefreshClick.bind(this));
47 47
48 this._resourceSelector = new WebInspector.StatusBarComboBox(this._onReplayRe sourceChanged.bind(this)); 48 this._resourceSelector = new WebInspector.StatusBarComboBox(this._onReplayRe sourceChanged.bind(this));
49 this._currentOption = this._resourceSelector.createOption(WebInspector.UIStr ing("<auto>"), WebInspector.UIString("Show state of the last replayed resource." ), ""); 49 this._currentOption = this._resourceSelector.createOption(WebInspector.UIStr ing("<auto>"), WebInspector.UIString("Show state of the last replayed resource." ), "");
50 controlsContainer.appendChild(this._resourceSelector.element); 50 controlsToolbar.appendStatusBarItem(this._resourceSelector);
51 51
52 /** @type {!Object.<string, string>} */ 52 /** @type {!Object.<string, string>} */
53 this._resourceIdToDescription = {}; 53 this._resourceIdToDescription = {};
54 54
55 /** @type {!Object.<string, !Object.<string, boolean>>} */ 55 /** @type {!Object.<string, !Object.<string, boolean>>} */
56 this._gridNodesExpandedState = {}; 56 this._gridNodesExpandedState = {};
57 /** @type {!Object.<string, !{scrollTop: number, scrollLeft: number}>} */ 57 /** @type {!Object.<string, !{scrollTop: number, scrollLeft: number}>} */
58 this._gridScrollPositions = {}; 58 this._gridScrollPositions = {};
59 59
60 /** @type {?CanvasAgent.ResourceId} */ 60 /** @type {?CanvasAgent.ResourceId} */
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 for (var index = 0; option; ++index, option = option.nextSibling) { 95 for (var index = 0; option; ++index, option = option.nextSibling) {
96 if (resourceId === option.value) { 96 if (resourceId === option.value) {
97 this._resourceSelector.setSelectedIndex(index); 97 this._resourceSelector.setSelectedIndex(index);
98 this._onReplayResourceChanged(); 98 this._onReplayResourceChanged();
99 break; 99 break;
100 } 100 }
101 } 101 }
102 }, 102 },
103 103
104 /** 104 /**
105 * @param {!Element} parent 105 * @param {!WebInspector.StatusBar} toolbar
106 * @param {string} className 106 * @param {string} className
107 * @param {string} title 107 * @param {string} title
108 * @param {function(this:WebInspector.CanvasProfileView)} clickCallback 108 * @param {function(this:WebInspector.CanvasProfileView)} clickCallback
109 * @return {!WebInspector.StatusBarButton} 109 * @return {!WebInspector.StatusBarButton}
110 */ 110 */
111 _createControlButton: function(parent, className, title, clickCallback) 111 _createControlButton: function(toolbar, className, title, clickCallback)
112 { 112 {
113 var button = new WebInspector.StatusBarButton(title, className + " canva s-replay-button"); 113 var button = new WebInspector.StatusBarButton(title, className + " canva s-replay-button");
114 parent.appendChild(button.element); 114 toolbar.appendStatusBarItem(button);
115 115
116 button.makeLongClickEnabled(); 116 button.makeLongClickEnabled();
117 button.addEventListener("click", clickCallback, this); 117 button.addEventListener("click", clickCallback, this);
118 button.addEventListener("longClickDown", clickCallback, this); 118 button.addEventListener("longClickDown", clickCallback, this);
119 button.addEventListener("longClickPress", clickCallback, this); 119 button.addEventListener("longClickPress", clickCallback, this);
120 return button; 120 return button;
121 }, 121 },
122 122
123 /** 123 /**
124 * @param {boolean} forward 124 * @param {boolean} forward
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 data[0] = nameElement; 520 data[0] = nameElement;
521 data[1] = valueElement; 521 data[1] = valueElement;
522 var node = new WebInspector.DataGridNode(data); 522 var node = new WebInspector.DataGridNode(data);
523 node.selectable = false; 523 node.selectable = false;
524 node.name = name; 524 node.name = name;
525 return node; 525 return node;
526 }, 526 },
527 527
528 __proto__: WebInspector.VBox.prototype 528 __proto__: WebInspector.VBox.prototype
529 } 529 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698