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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js

Issue 2417703006: DevTools: introduce a stub for the new audits panel (behind experiment). (Closed)
Patch Set: Created 4 years, 2 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
(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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698