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

Unified 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: missing file added. 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js b/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js
new file mode 100644
index 0000000000000000000000000000000000000000..e6ab2af2606b6fbf011d63dd77b21d014cf6bf24
--- /dev/null
+++ b/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js
@@ -0,0 +1,39 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @constructor
+ * @extends {WebInspector.Panel}
+ */
+WebInspector.Audits2Panel = function()
+{
+ WebInspector.Panel.call(this, "audits2");
+ this.contentElement.classList.add("vbox");
+ this.contentElement.appendChild(createTextButton(WebInspector.UIString("Start"), this._start.bind(this)));
+ this.contentElement.appendChild(createTextButton(WebInspector.UIString("Stop"), this._stop.bind(this)));
+}
+
+WebInspector.Audits2Panel.prototype = {
+ _start: function()
+ {
+ this._backend().then(backend => backend ? backend.send("start") : undefined).then(console.error.bind(console, "STARTED"));
+ },
+
+ _stop: function()
+ {
+ this._backend().then(backend => backend ? backend.send("stop") : undefined).then(console.error.bind(console, "STOPPED"));
+ },
+
+ /**
+ * @return {!Promise<?WebInspector.ServiceManager.Service>}
+ */
+ _backend: function()
+ {
+ if (!this._backendPromise)
+ this._backendPromise = WebInspector.serviceManager.createAppService("audits2_worker", "Audits2Service", false);
+ return this._backendPromise;
+ },
+
+ __proto__: WebInspector.Panel.prototype
+}
« no previous file with comments | « third_party/WebKit/Source/devtools/BUILD.gn ('k') | third_party/WebKit/Source/devtools/front_end/audits2/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698