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

Side by Side Diff: Source/devtools/front_end/ui_lazy/OverviewGrid.js

Issue 1163223003: DevTools: better error handling in paint profiler UI (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « Source/devtools/front_end/timeline/TimelinePaintProfilerView.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 zoom: function(zoomFactor, referencePoint) 123 zoom: function(zoomFactor, referencePoint)
124 { 124 {
125 this._window._zoom(zoomFactor, referencePoint); 125 this._window._zoom(zoomFactor, referencePoint);
126 }, 126 },
127 127
128 /** 128 /**
129 * @param {boolean} enabled 129 * @param {boolean} enabled
130 */ 130 */
131 setResizeEnabled: function(enabled) 131 setResizeEnabled: function(enabled)
132 { 132 {
133 this._window._setEnabled(!!enabled); 133 this._window.setEnabled(!!enabled);
134 } 134 }
135 } 135 }
136 136
137 137
138 WebInspector.OverviewGrid.MinSelectableSize = 14; 138 WebInspector.OverviewGrid.MinSelectableSize = 14;
139 139
140 WebInspector.OverviewGrid.WindowScrollSpeedFactor = .3; 140 WebInspector.OverviewGrid.WindowScrollSpeedFactor = .3;
141 141
142 WebInspector.OverviewGrid.ResizerOffset = 3.5; // half pixel because offset valu es are not rounded but ceiled 142 WebInspector.OverviewGrid.ResizerOffset = 3.5; // half pixel because offset valu es are not rounded but ceiled
143 143
(...skipping 27 matching lines...) Expand all
171 this._currentPositionArea.addEventListener("mousemove", this._onMouseMove.bi nd(this), true); 171 this._currentPositionArea.addEventListener("mousemove", this._onMouseMove.bi nd(this), true);
172 this._currentPositionArea.addEventListener("mouseout", this._hideCurrentPosi tion.bind(this), true); 172 this._currentPositionArea.addEventListener("mouseout", this._hideCurrentPosi tion.bind(this), true);
173 173
174 this._leftResizeElement = parentElement.createChild("div", "overview-grid-wi ndow-resizer"); 174 this._leftResizeElement = parentElement.createChild("div", "overview-grid-wi ndow-resizer");
175 this._leftResizeElement.style.left = 0; 175 this._leftResizeElement.style.left = 0;
176 WebInspector.installDragHandle(this._leftResizeElement, this._resizerElement StartDragging.bind(this), this._leftResizeElementDragging.bind(this), null, "ew- resize"); 176 WebInspector.installDragHandle(this._leftResizeElement, this._resizerElement StartDragging.bind(this), this._leftResizeElementDragging.bind(this), null, "ew- resize");
177 177
178 this._rightResizeElement = parentElement.createChild("div", "overview-grid-w indow-resizer overview-grid-window-resizer-right"); 178 this._rightResizeElement = parentElement.createChild("div", "overview-grid-w indow-resizer overview-grid-window-resizer-right");
179 this._rightResizeElement.style.right = 0; 179 this._rightResizeElement.style.right = 0;
180 WebInspector.installDragHandle(this._rightResizeElement, this._resizerElemen tStartDragging.bind(this), this._rightResizeElementDragging.bind(this), null, "e w-resize"); 180 WebInspector.installDragHandle(this._rightResizeElement, this._resizerElemen tStartDragging.bind(this), this._rightResizeElementDragging.bind(this), null, "e w-resize");
181 this._setEnabled(true); 181 this.setEnabled(true);
182 } 182 }
183 183
184 WebInspector.OverviewGrid.Events = { 184 WebInspector.OverviewGrid.Events = {
185 WindowChanged: "WindowChanged", 185 WindowChanged: "WindowChanged",
186 Click: "Click" 186 Click: "Click"
187 } 187 }
188 188
189 WebInspector.OverviewGrid.Window.prototype = { 189 WebInspector.OverviewGrid.Window.prototype = {
190 reset: function() 190 reset: function()
191 { 191 {
192 this.windowLeft = 0.0; 192 this.windowLeft = 0.0;
193 this.windowRight = 1.0; 193 this.windowRight = 1.0;
194 194
195 this._overviewWindowElement.style.left = "0%"; 195 this._overviewWindowElement.style.left = "0%";
196 this._overviewWindowElement.style.width = "100%"; 196 this._overviewWindowElement.style.width = "100%";
197 this._overviewWindowBordersElement.style.left = "0%"; 197 this._overviewWindowBordersElement.style.left = "0%";
198 this._overviewWindowBordersElement.style.right = "0%"; 198 this._overviewWindowBordersElement.style.right = "0%";
199 this._leftResizeElement.style.left = "0%"; 199 this._leftResizeElement.style.left = "0%";
200 this._rightResizeElement.style.left = "100%"; 200 this._rightResizeElement.style.left = "100%";
201 this._setEnabled(true); 201 this.setEnabled(true);
202 }, 202 },
203 203
204 /** 204 /**
205 * @param {boolean} enabled 205 * @param {boolean} enabled
206 */ 206 */
207 _setEnabled: function(enabled) 207 setEnabled: function(enabled)
208 { 208 {
209 enabled = !!enabled; 209 enabled = !!enabled;
210 if (this._enabled === enabled) 210 if (this._enabled === enabled)
211 return; 211 return;
212 this._enabled = enabled; 212 this._enabled = enabled;
213 this._currentPositionArea.style.cursor = enabled ? "text" : ""; 213 this._currentPositionArea.style.cursor = enabled ? "text" : "";
214 if (!enabled) 214 if (!enabled)
215 this._hideCurrentPosition(); 215 this._hideCurrentPosition();
216 }, 216 },
217 217
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 position = Math.max(0, Math.min(position, this._width)); 494 position = Math.max(0, Math.min(position, this._width));
495 if (position < this._startPosition) { 495 if (position < this._startPosition) {
496 this._windowSelector.style.left = position + "px"; 496 this._windowSelector.style.left = position + "px";
497 this._windowSelector.style.right = this._width - this._startPosition + "px"; 497 this._windowSelector.style.right = this._width - this._startPosition + "px";
498 } else { 498 } else {
499 this._windowSelector.style.left = this._startPosition + "px"; 499 this._windowSelector.style.left = this._startPosition + "px";
500 this._windowSelector.style.right = this._width - position + "px"; 500 this._windowSelector.style.right = this._width - position + "px";
501 } 501 }
502 } 502 }
503 } 503 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelinePaintProfilerView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698