Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / devtools / front_end / audits / AuditLauncherView.js
index d400f70..f237762 100644 (file)
@@ -46,7 +46,7 @@ WebInspector.AuditLauncherView = function(auditController)
     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);
@@ -55,14 +55,13 @@ WebInspector.AuditLauncherView = function(auditController)
 
     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;
@@ -82,7 +81,7 @@ WebInspector.AuditLauncherView.prototype = {
     {
         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();
@@ -92,7 +91,7 @@ WebInspector.AuditLauncherView.prototype = {
     {
         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();
@@ -141,13 +140,10 @@ WebInspector.AuditLauncherView.prototype = {
         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()
@@ -228,10 +224,10 @@ WebInspector.AuditLauncherView.prototype = {
      */
     _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);
@@ -244,7 +240,7 @@ WebInspector.AuditLauncherView.prototype = {
 
     _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)
@@ -279,7 +275,7 @@ WebInspector.AuditLauncherView.prototype = {
         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");
@@ -324,10 +320,8 @@ WebInspector.AuditLauncherView.prototype = {
 
     _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