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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui_lazy/TimelineGrid.js

Issue 1427823002: DevTools: Grey out outside parts of selection window on timeline overview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: refactor Created 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
4 * Copyright (C) 2009 Google Inc. All rights reserved. 4 * Copyright (C) 2009 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 26 matching lines...) Expand all
37 this.element.appendChild(WebInspector.Widget.createStyleElement("ui_lazy/tim elineGrid.css")); 37 this.element.appendChild(WebInspector.Widget.createStyleElement("ui_lazy/tim elineGrid.css"));
38 38
39 this._dividersElement = this.element.createChild("div", "resources-dividers" ); 39 this._dividersElement = this.element.createChild("div", "resources-dividers" );
40 40
41 this._gridHeaderElement = createElement("div"); 41 this._gridHeaderElement = createElement("div");
42 this._gridHeaderElement.classList.add("timeline-grid-header"); 42 this._gridHeaderElement.classList.add("timeline-grid-header");
43 this._eventDividersElement = this._gridHeaderElement.createChild("div", "res ources-event-dividers"); 43 this._eventDividersElement = this._gridHeaderElement.createChild("div", "res ources-event-dividers");
44 this._dividersLabelBarElement = this._gridHeaderElement.createChild("div", " resources-dividers-label-bar"); 44 this._dividersLabelBarElement = this._gridHeaderElement.createChild("div", " resources-dividers-label-bar");
45 this.element.appendChild(this._gridHeaderElement); 45 this.element.appendChild(this._gridHeaderElement);
46 46
47 this._leftCurtainElement = this.element.createChild("div", "timeline-cpu-cur tain-left"); 47 this._leftCurtainElement = this.element.createChild("div", "timeline-curtain -left");
48 this._rightCurtainElement = this.element.createChild("div", "timeline-cpu-cu rtain-right"); 48 this._rightCurtainElement = this.element.createChild("div", "timeline-curtai n-right");
49 } 49 }
50 50
51 /** 51 /**
52 * @param {!WebInspector.TimelineGrid.Calculator} calculator 52 * @param {!WebInspector.TimelineGrid.Calculator} calculator
53 * @param {number=} freeZoneAtLeft 53 * @param {number=} freeZoneAtLeft
54 * @return {!{offsets: !Array.<number>, precision: number}} 54 * @return {!{offsets: !Array.<number>, precision: number}}
55 */ 55 */
56 WebInspector.TimelineGrid.calculateDividerOffsets = function(calculator, freeZon eAtLeft) 56 WebInspector.TimelineGrid.calculateDividerOffsets = function(calculator, freeZon eAtLeft)
57 { 57 {
58 /** @const */ var minGridSlicePx = 64; // minimal distance between grid line s. 58 /** @const */ var minGridSlicePx = 64; // minimal distance between grid line s.
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 this._dividersElement.classList.remove("hidden"); 271 this._dividersElement.classList.remove("hidden");
272 }, 272 },
273 273
274 hideCurtains: function() 274 hideCurtains: function()
275 { 275 {
276 this._leftCurtainElement.classList.add("hidden"); 276 this._leftCurtainElement.classList.add("hidden");
277 this._rightCurtainElement.classList.add("hidden"); 277 this._rightCurtainElement.classList.add("hidden");
278 }, 278 },
279 279
280 /** 280 /**
281 * @param {number} gapOffset 281 * @param {number} left
282 * @param {number} gapWidth 282 * @param {number} right
283 */ 283 */
284 showCurtains: function(gapOffset, gapWidth) 284 showCurtains: function(left, right)
285 { 285 {
286 this._leftCurtainElement.style.width = gapOffset + "px"; 286 this._leftCurtainElement.style.width = (100 * left).toFixed(2) + "%";
287 this._leftCurtainElement.classList.remove("hidden"); 287 this._leftCurtainElement.classList.remove("hidden");
288 this._rightCurtainElement.style.left = (gapOffset + gapWidth) + "px"; 288 this._rightCurtainElement.style.width = (100 * (1 - right)).toFixed(2) + "%";
289 this._rightCurtainElement.classList.remove("hidden"); 289 this._rightCurtainElement.classList.remove("hidden");
290 }, 290 },
291 291
292 /** 292 /**
293 * @param {number} scrollTop 293 * @param {number} scrollTop
294 */ 294 */
295 setScrollTop: function(scrollTop) 295 setScrollTop: function(scrollTop)
296 { 296 {
297 this._dividersLabelBarElement.style.top = scrollTop + "px"; 297 this._dividersLabelBarElement.style.top = scrollTop + "px";
298 this._eventDividersElement.style.top = scrollTop + "px"; 298 this._eventDividersElement.style.top = scrollTop + "px";
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 330
331 /** @return {number} */ 331 /** @return {number} */
332 zeroTime: function() { }, 332 zeroTime: function() { },
333 333
334 /** @return {number} */ 334 /** @return {number} */
335 maximumBoundary: function() { }, 335 maximumBoundary: function() { },
336 336
337 /** @return {number} */ 337 /** @return {number} */
338 boundarySpan: function() { } 338 boundarySpan: function() { }
339 } 339 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698