this.element.classList.add("audit-launcher-view");
this.element.classList.add("panel-enabler-view");
- this._contentElement = document.createElement("div");
+ this._contentElement = createElement("div");
this._contentElement.className = "audit-launcher-view-content";
this.element.appendChild(this._contentElement);
this._boundCategoryClickListener = this._categoryClicked.bind(this);
this._sortedCategories = [];
- this._headerElement = document.createElement("h1");
+ this._headerElement = createElement("h1");
this._headerElement.className = "no-audits";
this._headerElement.textContent = WebInspector.UIString("No audits to run");
this._contentElement.appendChild(this._headerElement);
WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, WebInspector.NetworkManager.EventTypes.RequestStarted, this._onRequestStarted, this);
WebInspector.targetManager.addModelListener(WebInspector.NetworkManager, WebInspector.NetworkManager.EventTypes.RequestFinished, this._onRequestFinished, this);
- WebInspector.profilingLock().addEventListener(WebInspector.Lock.Events.StateChanged, this._updateButton, this);
var defaultSelectedAuditCategory = {};
defaultSelectedAuditCategory[WebInspector.AuditLauncherView.AllCategoriesKey] = true;
{
var request = /** @type {!WebInspector.NetworkRequest} */ (event.data);
// Ignore long-living WebSockets for the sake of progress indicator, as we won't be waiting them anyway.
- if (request.type === WebInspector.resourceTypes.WebSocket)
+ if (request.resourceType() === WebInspector.resourceTypes.WebSocket)
return;
++this._totalResources;
this._updateResourceProgress();
{
var request = /** @type {!WebInspector.NetworkRequest} */ (event.data);
// See resorceStarted for details.
- if (request.type === WebInspector.resourceTypes.WebSocket)
+ if (request.resourceType() === WebInspector.resourceTypes.WebSocket)
return;
++this._loadedResources;
this._updateResourceProgress();
this._auditRunning = auditRunning;
this._updateButton();
this._toggleUIComponents(this._auditRunning);
- if (this._auditRunning) {
- WebInspector.profilingLock().acquire();
+ if (this._auditRunning)
this._startAudit();
- } else {
+ else
this._stopAudit();
- WebInspector.profilingLock().release();
- }
},
_startAudit: function()
*/
_createCategoryElement: function(title, id)
{
- var labelElement = document.createElement("label");
+ var labelElement = createElement("label");
labelElement.id = this._categoryIdPrefix + id;
- var element = document.createElement("input");
+ var element = createElement("input");
element.type = "checkbox";
if (id !== "")
element.addEventListener("click", this._boundCategoryClickListener, false);
_createLauncherUI: function()
{
- this._headerElement = document.createElement("h1");
+ this._headerElement = createElement("h1");
this._headerElement.textContent = WebInspector.UIString("Select audits to run");
for (var child = 0; child < this._contentElement.children.length; ++child)
this._auditPresentStateElement.name = "audit-mode";
this._auditPresentStateElement.type = "radio";
this._auditPresentStateElement.checked = true;
- this._auditPresentStateLabelElement = document.createTextNode(WebInspector.UIString("Audit Present State"));
+ this._auditPresentStateLabelElement = createTextNode(WebInspector.UIString("Audit Present State"));
labelElement.appendChild(this._auditPresentStateLabelElement);
labelElement = this._buttonContainerElement.createChild("label");
_updateButton: function()
{
- var enable = this._auditRunning || (this._currentCategoriesCount && !WebInspector.profilingLock().isAcquired());
this._launchButton.textContent = this._auditRunning ? WebInspector.UIString("Stop") : WebInspector.UIString("Run");
- this._launchButton.disabled = !enable;
- this._launchButton.title = enable ? "" : WebInspector.anotherProfilerActiveLabel();
+ this._launchButton.disabled = !this._currentCategoriesCount;
},
__proto__: WebInspector.VBox.prototype