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

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: 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..ec46701c6aadbcebcae85dd47bbc2c896172b04a
--- /dev/null
+++ b/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js
@@ -0,0 +1,39 @@
+// Copyright (c) 2015 The Chromium Authors. All rights reserved.
dgozman 2016/10/14 03:14:58 Wrong copyright.
+// 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()
+ {
+ return this._backend().then(backend => backend ? backend.send("start") : undefined).then(console.error.bind(console, "STARTED"));
+ },
+
+ _stop: function()
+ {
+ return this._backend().then(backend => backend ? backend.send("stop") : undefined).then(console.error.bind(console, "STOPPED"));
+ },
+
+ /**
+ * @param {?WebInspector.ServiceManager.Service} backend
+ */
+ _backend: function(backend)
+ {
+ if (!this._backendPromise)
+ this._backendPromise = WebInspector.serviceManager.createAppService("audits2_worker", "Audits2Service");
+ return this._backendPromise;
+ },
+
+ __proto__: WebInspector.Panel.prototype
+}

Powered by Google App Engine
This is Rietveld 408576698