Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
|
dgozman
2016/10/14 03:14:58
Wrong copyright.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /** | |
| 6 * @constructor | |
| 7 * @extends {WebInspector.Panel} | |
| 8 */ | |
| 9 WebInspector.Audits2Panel = function() | |
| 10 { | |
| 11 WebInspector.Panel.call(this, "audits2"); | |
| 12 this.contentElement.classList.add("vbox"); | |
| 13 this.contentElement.appendChild(createTextButton(WebInspector.UIString("Star t"), this._start.bind(this))); | |
| 14 this.contentElement.appendChild(createTextButton(WebInspector.UIString("Stop "), this._stop.bind(this))); | |
| 15 } | |
| 16 | |
| 17 WebInspector.Audits2Panel.prototype = { | |
| 18 _start: function() | |
| 19 { | |
| 20 return this._backend().then(backend => backend ? backend.send("start") : undefined).then(console.error.bind(console, "STARTED")); | |
| 21 }, | |
| 22 | |
| 23 _stop: function() | |
| 24 { | |
| 25 return this._backend().then(backend => backend ? backend.send("stop") : undefined).then(console.error.bind(console, "STOPPED")); | |
| 26 }, | |
| 27 | |
| 28 /** | |
| 29 * @param {?WebInspector.ServiceManager.Service} backend | |
| 30 */ | |
| 31 _backend: function(backend) | |
| 32 { | |
| 33 if (!this._backendPromise) | |
| 34 this._backendPromise = WebInspector.serviceManager.createAppService( "audits2_worker", "Audits2Service"); | |
| 35 return this._backendPromise; | |
| 36 }, | |
| 37 | |
| 38 __proto__: WebInspector.Panel.prototype | |
| 39 } | |
| OLD | NEW |