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

Side by Side Diff: Source/devtools/front_end/resources/ServiceWorkersView.js

Issue 1063693002: [WIP] Support opening an inspector window for ServiceWorker running on Android (blink) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 8 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 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.VBox} 7 * @extends {WebInspector.VBox}
8 * @implements {WebInspector.TargetManager.Observer} 8 * @implements {WebInspector.TargetManager.Observer}
9 */ 9 */
10 WebInspector.ServiceWorkersView = function() 10 WebInspector.ServiceWorkersView = function()
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 stopButton.title = WebInspector.UIString("Stop"); 339 stopButton.title = WebInspector.UIString("Stop");
340 } else if (version.isStartable()) { 340 } else if (version.isStartable()) {
341 var startButton = runningStatusDiv.createChild("button", "servic e-workers-button service-workers-start-button service-workers-version-running-st atus-button"); 341 var startButton = runningStatusDiv.createChild("button", "servic e-workers-button service-workers-start-button service-workers-version-running-st atus-button");
342 startButton.addEventListener("click", this._startButtonClicked.b ind(this), false); 342 startButton.addEventListener("click", this._startButtonClicked.b ind(this), false);
343 startButton.title = WebInspector.UIString("Start"); 343 startButton.title = WebInspector.UIString("Start");
344 } 344 }
345 if (version.isRunning() || version.isStarting()) { 345 if (version.isRunning() || version.isStarting()) {
346 runningStatusDiv.classList.add("service-workers-version-running- status-inspectable"); 346 runningStatusDiv.classList.add("service-workers-version-running- status-inspectable");
347 var inspectButton = runningStatusDiv.createChild("div", "service -workers-version-inspect"); 347 var inspectButton = runningStatusDiv.createChild("div", "service -workers-version-inspect");
348 inspectButton.createTextChild(WebInspector.UIString("inspect")); 348 inspectButton.createTextChild(WebInspector.UIString("inspect"));
349 inspectButton.addEventListener("click", this._inspectButtonClick ed.bind(this, version.id), false); 349 inspectButton.addEventListener("click", this._inspectButtonClick ed.bind(this, version.workerId), false);
350 } 350 }
351 351
352 runningStatusDiv.createChild("div", "service-workers-version-running -status-text").createTextChild(version.runningStatus); 352 runningStatusDiv.createChild("div", "service-workers-version-running -status-text").createTextChild(version.runningStatus);
353 var scriptURLDiv = stateRowElement.createChild("div", "service-worke rs-version-script-url"); 353 var scriptURLDiv = stateRowElement.createChild("div", "service-worke rs-version-script-url");
354 scriptURLDiv.createChild("div", "service-workers-version-script-url- text").createTextChild(WebInspector.UIString("Script: %s", version.scriptURL.asP arsedURL().path)); 354 scriptURLDiv.createChild("div", "service-workers-version-script-url- text").createTextChild(WebInspector.UIString("Script: %s", version.scriptURL.asP arsedURL().path));
355 if (version.scriptLastModified) { 355 if (version.scriptLastModified) {
356 var scriptLastModifiedLabel = scriptURLDiv.createChild("label", " service-workers-info service-worker-script-last-modified", "dt-icon-label"); 356 var scriptLastModifiedLabel = scriptURLDiv.createChild("label", " service-workers-info service-worker-script-last-modified", "dt-icon-label");
357 scriptLastModifiedLabel.type = "info-icon"; 357 scriptLastModifiedLabel.type = "info-icon";
358 scriptLastModifiedLabel.createTextChild(WebInspector.UIString("L ast-Modified: %s", (new Date(version.scriptLastModified * 1000)).toConsoleTime() )); 358 scriptLastModifiedLabel.createTextChild(WebInspector.UIString("L ast-Modified: %s", (new Date(version.scriptLastModified * 1000)).toConsoleTime() ));
359 } 359 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 /** 406 /**
407 * @param {string} versionId 407 * @param {string} versionId
408 * @param {!Event} event 408 * @param {!Event} event
409 */ 409 */
410 _stopButtonClicked: function(versionId, event) 410 _stopButtonClicked: function(versionId, event)
411 { 411 {
412 this._manager.stopWorker(versionId); 412 this._manager.stopWorker(versionId);
413 }, 413 },
414 414
415 /** 415 /**
416 * @param {string} versionId 416 * @param {string} workerId
417 * @param {!Event} event 417 * @param {!Event} event
418 */ 418 */
419 _inspectButtonClicked: function(versionId, event) 419 _inspectButtonClicked: function(workerId, event)
420 { 420 {
421 this._manager.inspectWorker(versionId); 421 this._manager.detachWorker(workerId);
422 InspectorFrontendHost.openWorkerInspector(workerId);
422 } 423 }
423 } 424 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/host/InspectorFrontendHost.js ('k') | Source/devtools/front_end/sdk/ServiceWorkerManager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698