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

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

Issue 2678623002: DevTools: pass title when creating settings (Closed)
Patch Set: a Created 3 years, 10 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 * 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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 * @param {string} graphColor 390 * @param {string} graphColor
391 * @param {!Timeline.CountersGraph.Counter} counter 391 * @param {!Timeline.CountersGraph.Counter} counter
392 * @param {(function(number): string)|undefined} formatter 392 * @param {(function(number): string)|undefined} formatter
393 */ 393 */
394 constructor(countersPane, title, currentValueLabel, graphColor, counter, forma tter) { 394 constructor(countersPane, title, currentValueLabel, graphColor, counter, forma tter) {
395 this._countersPane = countersPane; 395 this._countersPane = countersPane;
396 this.counter = counter; 396 this.counter = counter;
397 this._formatter = formatter || Number.withThousandsSeparator; 397 this._formatter = formatter || Number.withThousandsSeparator;
398 var container = countersPane._infoWidget.element.createChild('div', 'memory- counter-selector-info'); 398 var container = countersPane._infoWidget.element.createChild('div', 'memory- counter-selector-info');
399 399
400 this._setting = Common.settings.createSetting('timelineCountersGraph-' + tit le, true); 400 this._setting = Common.settings.createSetting('timelineCountersGraph-' + tit le, true, false, title);
401 this._filter = new UI.ToolbarCheckbox(title, title, this._setting); 401 this._filter = new UI.ToolbarSettingCheckbox(this._setting, title);
402 this._filter.inputElement.classList.add('-theme-preserve'); 402 this._filter.inputElement.classList.add('-theme-preserve');
403 var color = Common.Color.parse(graphColor).setAlpha(0.5).asString(Common.Col or.Format.RGBA); 403 var color = Common.Color.parse(graphColor).setAlpha(0.5).asString(Common.Col or.Format.RGBA);
404 if (color) { 404 if (color) {
405 this._filter.element.backgroundColor = color; 405 this._filter.element.backgroundColor = color;
406 this._filter.element.borderColor = 'transparent'; 406 this._filter.element.borderColor = 'transparent';
407 } 407 }
408 this._filter.inputElement.addEventListener('click', this._toggleCounterGraph .bind(this)); 408 this._filter.inputElement.addEventListener('click', this._toggleCounterGraph .bind(this));
409 container.appendChild(this._filter.element); 409 container.appendChild(this._filter.element);
410 this._range = this._filter.element.createChild('span', 'range'); 410 this._range = this._filter.element.createChild('span', 'range');
411 411
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 /** 625 /**
626 * @override 626 * @override
627 * @return {number} 627 * @return {number}
628 */ 628 */
629 boundarySpan() { 629 boundarySpan() {
630 return this._maximumBoundary - this._minimumBoundary; 630 return this._maximumBoundary - this._minimumBoundary;
631 } 631 }
632 }; 632 };
633 633
634 Timeline.CountersGraph.Calculator._minWidth = 5; 634 Timeline.CountersGraph.Calculator._minWidth = 5;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698