| OLD | NEW |
| 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 * @implements {SDK.SDKModelObserver<!SDK.ServiceWorkerManager>} | 5 * @implements {SDK.SDKModelObserver<!SDK.ServiceWorkerManager>} |
| 6 * @unrestricted | 6 * @unrestricted |
| 7 */ | 7 */ |
| 8 Resources.ServiceWorkersView = class extends UI.VBox { | 8 Resources.ServiceWorkersView = class extends UI.VBox { |
| 9 constructor() { | 9 constructor() { |
| 10 super(true); | 10 super(true); |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 254 |
| 255 var statusValue = this._wrapWidget(this._section.appendField(Common.UIString
('Status'))); | 255 var statusValue = this._wrapWidget(this._section.appendField(Common.UIString
('Status'))); |
| 256 statusValue.removeChildren(); | 256 statusValue.removeChildren(); |
| 257 var versionsStack = statusValue.createChild('div', 'service-worker-version-s
tack'); | 257 var versionsStack = statusValue.createChild('div', 'service-worker-version-s
tack'); |
| 258 versionsStack.createChild('div', 'service-worker-version-stack-bar'); | 258 versionsStack.createChild('div', 'service-worker-version-stack-bar'); |
| 259 | 259 |
| 260 if (active) { | 260 if (active) { |
| 261 var scriptElement = this._section.appendField(Common.UIString('Source')); | 261 var scriptElement = this._section.appendField(Common.UIString('Source')); |
| 262 scriptElement.removeChildren(); | 262 scriptElement.removeChildren(); |
| 263 var fileName = Common.ParsedURL.extractName(active.scriptURL); | 263 var fileName = Common.ParsedURL.extractName(active.scriptURL); |
| 264 scriptElement.appendChild(Components.Linkifier.linkifyURL(active.scriptURL
, fileName)); | 264 scriptElement.appendChild(Components.Linkifier.linkifyURL(active.scriptURL
, {text: fileName})); |
| 265 scriptElement.createChild('div', 'report-field-value-subtitle').textConten
t = | 265 scriptElement.createChild('div', 'report-field-value-subtitle').textConten
t = |
| 266 Common.UIString('Received %s', new Date(active.scriptResponseTime * 10
00).toLocaleString()); | 266 Common.UIString('Received %s', new Date(active.scriptResponseTime * 10
00).toLocaleString()); |
| 267 | 267 |
| 268 var activeEntry = versionsStack.createChild('div', 'service-worker-version
'); | 268 var activeEntry = versionsStack.createChild('div', 'service-worker-version
'); |
| 269 activeEntry.createChild('div', 'service-worker-active-circle'); | 269 activeEntry.createChild('div', 'service-worker-active-circle'); |
| 270 activeEntry.createChild('span').textContent = | 270 activeEntry.createChild('span').textContent = |
| 271 Common.UIString('#%s activated and is %s', active.id, active.runningSt
atus); | 271 Common.UIString('#%s activated and is %s', active.id, active.runningSt
atus); |
| 272 | 272 |
| 273 if (active.isRunning() || active.isStarting()) { | 273 if (active.isRunning() || active.isStarting()) { |
| 274 createLink(activeEntry, Common.UIString('stop'), this._stopButtonClicked
.bind(this, active.id)); | 274 createLink(activeEntry, Common.UIString('stop'), this._stopButtonClicked
.bind(this, active.id)); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 * @return {!Element} | 455 * @return {!Element} |
| 456 */ | 456 */ |
| 457 _wrapWidget(container) { | 457 _wrapWidget(container) { |
| 458 var shadowRoot = UI.createShadowRootWithCoreStyles(container); | 458 var shadowRoot = UI.createShadowRootWithCoreStyles(container); |
| 459 UI.appendStyle(shadowRoot, 'resources/serviceWorkersView.css'); | 459 UI.appendStyle(shadowRoot, 'resources/serviceWorkersView.css'); |
| 460 var contentElement = createElement('div'); | 460 var contentElement = createElement('div'); |
| 461 shadowRoot.appendChild(contentElement); | 461 shadowRoot.appendChild(contentElement); |
| 462 return contentElement; | 462 return contentElement; |
| 463 } | 463 } |
| 464 }; | 464 }; |
| OLD | NEW |